Nick Bewley
Nick Bewley

Reputation: 9289

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!

Upvotes: 0

Views: 258

Answers (2)

Karl-Andr&#233; Gagnon
Karl-Andr&#233; Gagnon

Reputation: 33870

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

Upvotes: 2

Becuzz
Becuzz

Reputation: 6866

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

Upvotes: 2

Related Questions