.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

Problem with css vertical alignment

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :ASP.Net


I want to create a box, that looks and acts exactly like in this image (I have edited it in photoshop to make it look like what I want):


As you can see, the heading should be vertically middle aligned. And if the text exceeds the width, the text should then take up the place like normal behaviour.

Ive tried to accomplish this for a long time now, but cant get it right! Problem is that I cant make the text vertically align, since I´m using the display:block;

Here is what i have:


<div class="outer">
  <span class="heading" >Long heading that should take up all the place, but not expand the box </span>
  <div class="inner">
  <b>Description</b><br />just some random text<br />blablabla<br />


  border:1px solid #797979;


View Complete Post

More Related Resource Links

gridview table alignment problem

hi all, i designed a gridiview, within that ItemTemplate i drew an table then tr then some of td's, now the problem is after every row im getting one empty row, what is the problem and how to resolve it. below is my code <ItemTemplate>                                             <table cellspacing="0" cellpadding="0" style="border-right:1px solid Black;" >                                                 <tr  >                                                     <td width="1%" align="center" style="border-right:1px solid Black;">          &n

When I click on a TextBox the text moves a little bit for Vertical Alignment

I have a Grid of text boxes defined in the XAML using the following code:         <Border Grid.Row="2" Grid.Column="11" Style="{StaticResource BorderStyleContent}" >             <TextBox Text="-15.11" Style="{StaticResource EditableTextBox}"/>         </Border> The styles are defined below:         <Style x:Key="BorderStyleContent" TargetType="Border">             <Setter Property="BorderBrush" Value="Black"/>             <Setter Property="BorderThickness" Value="1"/>             <Setter Property="Padding" Value="2"/>             <Setter Property="SnapsToDevicePixels" Value="True"/>         </Style>         <Style x:Key="EditableTextBox" TargetType="TextBox">         &nb

Datagrid CellStyle vertical align problem


Im using the WPF toolkit when I set a textcolum cell style to align the text to the center vertically it becomes very hard to select the text

without the cellstyle I can just click anywhere in the cell and begin editing the text in there, but with the cellstyle you have a very limited area in the cell where you can select the text field

does anyone have any way to fix this?

                      <Style TargetType="{x:Type dg:DataGridCell}">
                          <Setter Property="VerticalAlignment" Value="Center"></Setter>

Simple CSS alignment problem



Im trying to create a page with css layout instead of tables.

I want to create a div that is 100% long, and contains three buttons (maybe more?). The first button should be placed to the left, the second in the middle, and the third to the right. They shall, of course, be placed on the same horizontal line.

How to do this with css?

Thanks alot :)

Kind regards,


Vertical alignment of DataGrid row content



I have a regular DataGrid from WPF 4.0 RTM, where I put data from database. In order to make clean & light style of DataGrid I use a tall/high rows and by default DataGrid aligns row content in top vertical position, but I want to set a center vertical alignment.

I already tried to use this property 


in DataGrid options, but it doesn't help me.

Here is an example of XAML-code, describing my DataGrid without center vertical alignment:

<DataGrid x:Name="ContentDataGrid"
		Style="{StaticResource ContentDataGrid}"

WPF Ribbon's application menu alignment problem: bug or programmer error?

I'm using WPF 4's (in .NET 4) ribbon control, version 3.5.40729.1, in my application. The application menu and all sub-menu popups align as far left as possible, usually far outside the ribbon window. The expected location is that the application menu's left edge aligns with the ribbon window's left edge, and that sub-menu popups will align with the left edge of the right (usually recent items) content pane.

Here's an example screen shot illustrating the issue I'm having. Note that the left edge of this screen shot is the left edge of my monitor.

Here's a snippet of code showing the XAML of the RibbonWindow root element and the beginning of the ribbon declaration:


gridview alignment problem


I have a table in which  gridview1 is created when the user clicks a button outside this table.

when the user then clicks on a rowcommand button from Gridview1 a second gridview, chldgrdvw, is created in the next cell on the same row of the table.

My issue is that I would like the second gridview (chldgrdvw) to align with the the row clicked from gridview1.  Currently I can only get chldgv to align based on its table cell properties ie (top of cell, left of cell, bottom of cell etc..)

Gridview Header & table data alignment problem



Newbie to ASP.net. Programming in C#.

I'm querying a SQL database and displaying the results in a gridview.

The results can be many records so I need to provide the facility to scroll. To display the headers when scroling I have implemented ( in my asp code) the headers in another table and the data is in another table. I see now I cannot align the column headers with the table data.

Appreciate any help to fix this issue.

If this method is not a good one to display headers with data please suggest another method.( Some example code guidance would really help)

Here is my ASP code.

<div id="divProjectTableHeaderFullDetail" runat="server" style="background-color: #993300;
            height: 40px; width: 770px; margin: 0;  padding: 0 ; " >
            <table style="font-family: Arial; font-size: 10pt; color: white;" cellspacing="0"

Bubble bar alignment problem



I am using bubblebar dll from devcomponent in vb.net project. i have embedded bubblebar in my project.

But i want to set ita alignment according to the position of bubble bar.

I have a 2 button in form, when i press that Top button  --->  bubble bar position be at top and the icons are enlarging in downwards position.

and when i press Bottom button---> bubble position set to bottom of screen but icons are still enlarging in downwards position, though i want them to rise upwards.

i have tested bubblebar1.alignment=Top on    TopButton         and   bubblebar1.alignment=Bottom  on BottomButton.

It doe'nt works.


Kindly i anyone have idea how to do it. 

Please let me  know.


Nikhil Malhotra 

Sate Machine Alignment problem



I've a State Machine Workflow that it has a very big size, I mean more than 40 states. The problem is when I open the workflow in design view on Visual Studio 2008, all the states are misaligned, like one bellow the other. But if the same workflow I open in other computer with visual studio 2008, it shown good, the states are where they have to be.

I don't know what it is, maybe same bad configuration of the VS.

Any idea? 

Julio E. Szabo

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.

Virtual Path Problem


 I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,

Note that the slashes go in different directions

I've tried a number of things but nothing seems to work. Thanks-


Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Web.UI.WebControls

Imports System.Drawing.Imaging.ImageCodecInfo
Partial Class Protected_imageupload
    Inherits System.Web.UI.Page
    Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        ' Initialize variables
        Dim sSavePath As String
        Dim sThumbExtension As String
        Dim intThumbWidth As Integer
        Dim intThumbHeight As Integer
        Dim sFilename As String = ""
        ' Set constant values
        'sSavePath = "images/"
        sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"

        sThumbExtension = "_thumb"
        intThumbWidth = 160
        intThumbHeight = 120

        ' If file field isn?t empty
        If FilUpload.PostedFile IsNot Nothing Then
            ' Check file size (mustn?t be 0)
            Dim myFile As Http

Strange Photo upload problem


I'm working project it's live on shared hosting

we'er uploading photos to a file on the server everything works fine the photo is resized renamed and sent to the folder

the upload page returns the thumbnail and the full size photo it's there all the photos have to be approved by an admin

twice now after they have been approved they disapear I checked the folder they are not there could there be anywhere

on the server they could get hung up before they go into the folder I have it setup so when you delete the data base entry it deletes the photo from the folder othe than that you need to open the folder and delete the photo this has hapened twice now I tried to recreate it with no luck

thaks for your help in advance

ASP.Net Caching problem ??


I'm having a problem with an asp.net 3.0 application using a gridview to display data.  The problem seems to be that despite a brand new .selectCommand being sent to the sqlDataSource, the gridview starts displaying data from *someone else's* query.  For example, user A is logged in and will be working fine until a few page submissions later when the gridview data starts suddenly showing information that belongs to another user. 

This is my first asp.net application, though I've been working with classic asp and ADO for years so I'm used to sending a SQL string and getting back the results from that string.  Apparently there is a complex caching system which is interferring which I do not at all understand so at this point I just want to stop the server from caching any data whatsoever.  Is this possible?

Any and all help will be much appreciated!!

Could some one tell me whats the Problem with this String Manipulation ??? C#.net



I store some values from code behind to a label which is Hidden !

<asp:Label ID="lbl_Hidden" runat="server" Visible = "false"></asp:Label>

and at the page load event i retrieve the value of the label & assign it to a string !

stringvalue = lbl_Hidden.Text;

Now i dont know why this manipulation does'nt work !

I've a character 'A' in the string and i'm unable to replace it with a space !

stringvalue.Replace(A, " ");

Wot do u think abt it ????

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