Solved

Stylesheet CSS Fieldset DIV Label Width?

Posted on 2014-01-11
2
472 Views
Last Modified: 2014-01-11
Q. How do I change the width of several nested Labels in a fieldset?

This doesn't work:
        fieldset.managerList > div > label
        {
             width: 200px;
        }

<fieldset class="managerList">
    <div>
       <label>First Name:</label>
    </div>

    <div>
       <label>Last Name:</label>
    </div>

    <div>
       <label>Nick Name:</label>
    </div>
</fieldset>
0
Comment
Question by:WorknHardr
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 300 total points
ID: 39773611
The reason it isn't doing anything is that Label elements are inline elements rather than block, so width has no effect by default.

If you change the display attribute to inline-block then you should get the effect you want:
fieldset.managerList > div > label
{
     display: inline-block;
     width: 200px;
}

Open in new window

0
 

Author Closing Comment

by:WorknHardr
ID: 39773689
thx...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now