Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Text alignment in form label

Posted on 2014-04-24
6
Medium Priority
?
196 Views
Last Modified: 2014-04-24
I am an amateur at CSS.  There is a contact form at www.mauivacationrental.com/contact.htm with form field labels.  I thought I established a right-alignment for those labels in styling on that page, but "City" and "Country" labels appear to be left-aligned.  Please advise.
0
Comment
Question by:ddantes
[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
  • 2
  • 2
6 Comments
 
LVL 34

Assisted Solution

by:Paul MacDonald
Paul MacDonald earned 500 total points
ID: 40021127
Change...

City:
<input type="text" class="fullfld" style="margin-left:47px; margin-right:60px" maxlength="30" name="City">

...and...

Country:
<input type="text" class="fullfld" style="margin-left:20px; margin-right:20px" maxlength="15" name="Country">

...to...

City:
<input type="text" class="fullfld" style="margin-right:60px;" maxlength="30" name="City">

...and...

Country:
<input type="text" class="fullfld" style="margin-right:20px;" maxlength="15" name="Country">
0
 
LVL 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 40021162
Your issue is you have your input inside a P tag and the input you have inline style for margin-left.  Take out the margin left and you are kind of good.

<input type="text" class="fullfld" style="margin-left:47px; margin-right:60px" maxlength="30" name="City">

Open in new window



Using a <label>something</label><input name=..> would be better though.
0
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 40021174
I got it backwards up above.  Change...

City:
<input type="text" class="fullfld" style="margin-left:47px; margin-right:60px" maxlength="30" name="City">

...and...

Country:
<input type="text" class="fullfld" style="margin-left:20px; margin-right:20px" maxlength="15" name="Country">


...to...

City:
<input type="text" class="fullfld" style="margin-left:47px;" maxlength="30" name="City">

...and...

Country:
<input type="text" class="fullfld" style="margin-left:20px;" maxlength="15" name="Country">
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Closing Comment

by:ddantes
ID: 40021635
Thanks to you both.   When there are nested components, it's difficult for me to keep track of which element is being styled.  It worked to remove of the left margin from "fullfld", which created a gap between the label and the text field, and insert a left margin in the required "formlabel" elements so that things line up.
0
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 40021643
Try and avoid styling inline and use css instead.  Otherwise when you try and style using css, the inline takes precedent.
0
 

Author Comment

by:ddantes
ID: 40021644
That's good advice, thank you.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
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... …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

636 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