Solved

Stylesheet CSS Fieldset DIV Label Width?

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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…

808 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