.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

gap between inline-block divs

Posted By:      Posted Date: August 26, 2010    Points: 0   Category :ASP.Net

I have two divs, inline-block, width:50%.  When the width is 50% the two divs do not fit on the same line and the browser renders them one under the other.  Change the width to 49% and give them a background color. The divs render side by side, but with a small gap between them. I assume that gap is the reason the 50% width divs don't fit side by side. 

I am trying different combinations of margin:0; padding:0; line-height:0; border:0px;.

How can I make is so there is no gap, horizontal and vertical, between inline-block divs?


		<style type="text/css"> 




<body style="margin:0px; padding:0px;">

<div class="SideBySide" style="background-color:Green;">
<div class="SideBySide" style="background-color:Red;">


View Complete Post

More Related Resource Links

Changing Properties/Attributes of a Webpart in inline code block - Error 'System.Web.UI.WebControl

I'm trying this code below, but gettting error: System.Web.UI.WebControls.WebParts.WebPart' does not contain a definition for 'FilterValue1' I need to change the value of the FilterValue1 properties of a content Query WebPart with title = Applicant Files. Thanks in Advance!
protected override void OnLoad(EventArgs e) {  base.OnLoad(e); SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite SiteCollection = new SPSite("https://somesite/")) { SPWeb myWeb = SiteCollection.OpenWeb(); myWeb.AllowUnsafeUpdates = true; Microsoft.SharePoint.WebPartPages.SPLimitedWebPartManager mgr = null; mgr = myWeb.GetLimitedWebPartManager("default.aspx",System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared); foreach (System.Web.UI.WebControls.WebParts.WebPart myWebPart in mgr.WebParts) { if (myWebPart.Title == "Applicant Files") { myWebPart.FilterValue1 = "/13"; mgr.SaveChanges(myWebPart); break; } } } }); }

FlowDocument: how to convert a Block item to Inline item so they can show at one line?



First, sorry for my poor English, I know this question may sound absurd, but there are many situations like showing several tables in one line, customized List Marker... which may need to show several Block items at one line.

Now I got 3 approaches,

1: use Floater or Figure, but they only provide basic functions for docking, so they cannot display more than 3 block decently, and when processing deeply nested lines, the result got so ugly and very difficult to coordinate.

2: use Table to layout the page, it do has a good result, but as it is a rule in both WPF and HTML that Table should be use to display Tabular data, it should not be used in layout.

3: use InlineUIContainer to wrap each Block in a Control which can display FlowDocument, this may be the worst option.

any ideas? thanks, in advance.

How Do I Enable Inline GridView Editing?

Now that you have created a site with Edit and Details views, how do you enable inline editing in a GridView control? This video shows you how, and also touches on routing.

GridView inline Master/Detail record display

This code drop is part of a smash and grab series. If you're in a rush, you can just grab this code and insert it into your application, no understanding is required. When you have some time (ya, right) you may want to review the source code.

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

how to set break point at inline code

I set the element height value by using inline code 
<%# Eval("s") %>
where "s" is the variable declared in page load event. when i run the application it don't set the height. 
Is there any way, i can set break point into .aspx file. i mean how i can check if my Eval("s") get the value.  

divs do not display side by side


I have two divs. I want them to display side by side, on the same row. Using display:inline-block I can do that. But as soon as I position some text in the bottom right corner of div1, the two divs do not have the same vertical position. They are side by side, but the 2nd div starts at the vertical position of the positioned text in the 1st div.   Why would it do that?  Both Chrome and IE8 render it the same way.

( I am doing the nesting of the divs on the left side so that I can position absolutely within a div and not the page. I can't get text to position in the lower right corner of a div any other way. )


  <div style="border:2px solid black;">
    <div style="display:inline-block;">
      <div style="width:10em; height:4em; background:orange;color:White;
        <span style="position:absolute;bottom:0px;right:0px;">
        login message

    <div s

Inline conditional output


Is it possible to somehow output some content based upon some conditional check in Razor? If not, I hope this possibility will be added in the future. What I want to do is the following:

<option value="1" @if(ListMode == 1) { = "selected=\"true\"" }>Full list</option>

As I can't figure out a way to do this, I have to either make a helper that does it for me or write duplicate code.

Error while using exception handling block el 4.1


Hi Folks,


i am trying to use tyhe exception handling block of Enterprise library 4.1.


I just createda polisy and used IndexOutOfRangeException and added a replace handler and a logging handler to it.

I am using the NotifyRethrow PostHandlingAction to the exception.


During runtime I am getting an exception on the HandleException event, The exception is added below:



Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 42:             catch (Exception ex)
Line 43:             {
Line 44:                 bool reThrow = ExceptionPolicy.HandleException(ex, "ReplacePolicy");
Line 45:         

Using the ConsoleTraceListener with the Enterprise Library 3.1 Logging Block


I'm new to using the Logging application block.  I think I have a pretty good handle on how things work.  However, I'm running into a problem.  I'm using the RollingFlatFileListener and I have formatted the logging template to be more like the logging we are replacing.  However, in our console apps when the ConsoleTraceListener is added it still logs it out in the default text template format.  Is there any way to get around this?  Currently it looks like I will have to create a new TraceListener called FormattedConsoleListener that allows a text formatter to be associated with it.  Is this the only way?

set messageTemplateResourceName from resource file in Validation appication block.



  I am using Validation application block in my project and want to set validation message from resource file, but not able to do that. I tried giving the path of resource file in messageTemplateResourceType and name of resource in messageTemplateResourceName. But it did not help as I only receive the message if I have set something in messageTemplate even after setting the resource file.

Here is my code:

<validator lowerBound="1" lowerBoundType="Inclusive" upperBound="250"
              upperBoundType="Inclusive" negated="false" messageTemplate=""
              messageTemplateResourceType="Asurion.jCare.Common.Resources.UIResources.PerilTypeAndDetailsSection, Asurion.jCare.Common.Resources, Version=, Culture=neutral, PublicKeyToken=null"
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.StringLengthValidator, Microsoft.Practices.Enterpris

Microsoft Application Block for Data Access in .NET


Hi all,

I was rummaging the internet learning aspx and came across the concept of: Microsoft Application Block for Data Access in .NET

It seems great of course. The articles are all early 2003-5 such as


So the question is - is this tech still relevant and should I be using it?



PIAB And WCF: Integrating the Policy Injection Application Block with WCF Services


Using the PIAB you can enhance WCF services with policies such as validation, performance monitoring, authorization and caching without having to change a line of code.

Hugh Ang and David San Filippo

MSDN Magazine February 2008

Data Points: The Enterprise Library Data Access Application Block, Part 3


E nterprise applications can have a wide variety of data update requirements. Sometimes you need to save multiple rows of changes at once within a single transaction. Other times, the user must be allowed to enter multiple rows of data, send them to the database in a batch; and if a row or two fails, only the rows that succeeded should be committed and remain committed.

John Papa

MSDN Magazine October 2005

Data Points: The Enterprise Library Data Access Application Block, Part 2


Last month I explored the foundation of the Enterprise Library Data Access Application Block (DAAB) including how it all fits into an architecture (see Data Points: The Enterprise Library Data Access Application Block, Part 1).

John Papa

MSDN Magazine August 2005

Data Points: The Enterprise Library Data Access Application Block, Part 1


A solid data access later (DAL) can benefit an application by hiding redundant tasks, helping handle exceptions more gracefully, helping clean up resources more efficiently, and providing a layer of abstraction from the database.

John Papa

MSDN Magazine July 2005

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend