Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Stylesheet CSS Fieldset DIV Label Width?

Posted on 2014-01-11
2
Medium Priority
?
507 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 1200 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Suggested Courses

721 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