Div Not Responding to Width CSS

In the process of creating a form, and I want the text labels to all be the same width. For some reason that I cannot discern, using width is not working as in:

.form-label {  display:inline; width: 160px; }

<div class="form-label required">First Name:</div>

Jsfiddle

How can I get the .form-label class to respond to the width declaration? Thank you!

Answers


Change it from display:inline to display:inline-block.


Object position as inline have no width attribute, i think you are looking for inline-block;


Need Your Help

Wrong expected result from DateTime diff

php datetime

$date1 = new DateTime("2014-02-28");

Ruby on Rails will_paginate an array

ruby-on-rails pagination will-paginate

I was wondering if someone could explain how to use will_paginate on an array of objects?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.