Tips and Snips: Creative Website Hacks for Creative People
ImageandAspect
Philosophy
About
Demos
Contact
Privacy
Terms
Subscribe
Tips and Snips: Creative Website Hacks for Creative People
  • ImageandAspect
  • Philosophy
  • About
  • Demos
  • Contact
  • Privacy
  • Terms
  • Subscribe
Browsing Category
Archive
CSS

How to give your FORMS structure (without tables)

Photo of a structured looking form with text beside the input-fields, without using tables
April 5, 2020 by Diane Metcalf, M.S.I.T. No Comments

How to create a structured looking form with text beside the input-fields, without using tables.

Here’s how to do it with CSS:

Example 1:

In this example, I’m going to simply create a standard form with no CSS:

HTML:

<body>

<form>
First name:
<input type=”text” name=”firstname”><br>
Last name:
<input type=”text” name=”lastname”>
</form>

</body>

It displays like this:

before-1-300x67 How to give your FORMS structure (without tables)

As you can see, the colons and the text fields are not aligned.

Now we’ll use some CSS to get it to look the way I want.

Example 2:

First, I create a class for the text. I’ll call it “fieldname” so I can easily remember it and  it’s pretty self-evident what it’s purpose is.

Here’s the new code:

HTML:

<body>

<form>
<div class=”fieldname“>First name:</div>
<input name=”firstname” type=”text”>

<br>

<div class=”fieldname“>Last name:</div>
<input name=”lastname” type=”text”>
</form>

</body>

Now we use CSS to style the fieldname class. We float the text (fieldname)  to the left, and align the text on the right, so the colons are aligned one above the other. Then let’s give it a decent width so all the text characters fit on one line, and we’ll add some margin between the text and the input-field, to make everything more visually appealing.

CSS:

.fieldname {

float: left;

text-align: right;

margin-right: 15px;

width: 100px;

}

Here’s what it looks like now:

after-300x66 How to give your FORMS structure (without tables)

Much more attractive! And all without using tables!

Questions?

[email protected]

My Contact Page

Other articles you might like

-How your personal brand makes the difference

-Using images: Tips to improve your SEO rankings

-Use a customer thank-you page to avoid missed opportunities

 

About the author

diane-author-300x181 How to give your FORMS structure (without tables)

I developed Image and Aspect because I believe that professionals need to have an impactful web presence. One that showcases their unique talents, skills, and abilities as well as their values and style. A presence that focuses on social engagement and connection.

I’m passionate about what I do; I like helping fellow humans, I like having all kinds of social connection with others, and I want to give back, to make the world a better place.

I do much of the designing and coding myself, and I also have a wonderful network of professionals that may contribute as well; photographers, copywriters, branding experts.

I love designing and coding beautiful, elegant and responsive web creations. I ALSO teach and help others who want to learn how to do it themselves.

‘Tips and Snips’ is my blog, and it’s full of information and inspiration to help transform any online persona from “meh” to AMAZING! Sign-up HERE to get blog posts right to your in-box every Friday! I write about Design, Marketing, Search Engine Optimization, Branding, Vlogging, Color Theory, HTML5, CSS3, Bootstrap, WordPress, Social Media…anything you’d want to know to get yourself noticed online.

Visit Image and Aspect to learn more about your web presence options

Diane M. Metcalf, M.S.

Read more

Reading time: 2 min

Find Topics

 Image and Aspect is a solution-based web presence development service for creatives, entrepreneurs and solopreneurs. We create impactful online presences that showcase your talents, skills, values & style, while focusing on influencing, engagement & connection.

 

It’s a collaborative process; we use streamlined project-management & communications tools so you’ll always know what’s happening with your project. And by adding personalized service, you get  one-on-one support. We want you to feel equipped, educated & empowered to ask questions & make decisions about your web presence & web platform.

 

Tips and Snips was born from the desire to give back; to support anyone who has an interest in learning the art and science of  web design and coding.

 

Thanks for your interest!

~Diane Metcalf, MS

Image and Aspect logo

Connect with me on Twitter!

Follow @MetcalfDiane

Categories

  • Blogging
  • bootstrap
  • CSS
  • Design
  • Entrepreneurs and Creatives
  • HTML
  • Job Seekers
  • Marketing
  • security
  • SEO
  • Thoughts
  • WordPress

Recent Posts

  • Why you need a customer thank-you page December 23, 2020
  • 10 things to do after creating your site November 8, 2020
  •  7 web design principles you should know October 15, 2020
  • Make your site mobile friendly with media queries September 18, 2020
  • Create a tiny browser icon for your site ID August 19, 2020

Older Posts

  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018

Tags

  • Blogging
  • bootstrap
  • CSS
  • Design
  • Entrepreneurs and Creatives
  • HTML
  • Job Seekers
  • Marketing
  • security
  • SEO
  • Thoughts
  • WordPress

Image and Aspect on Instagram

recent posts

  • Why you need a customer thank-you page
  • 10 things to do after creating your site
  •  7 web design principles you should know
  • Make your site mobile friendly with media queries
  • Create a tiny browser icon for your site ID

ImageAndAspect.com © 2020 Designed by ImageandAspect

 
This website or its third party tools use cookies to enhance our experience. More info CLICK HERE.