Solved

Stylesheet CSS Fieldset DIV Label Width?

Posted on 2014-01-11
2
467 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This article discusses four methods for overlaying images in a container on a web page
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 different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

758 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

17 Experts available now in Live!

Get 1:1 Help Now