Solved

About space -again-URGENT

Posted on 2003-11-29
4
190 Views
Last Modified: 2010-04-09
hi,
 In order to have this:
 
      Username:________
      Password:________

i use this:
<!--
form  {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 14px;
      color: #000000;
      }

label {
      float: left;
      width:220px;
      clear:all;
      padding-left:80px;

      }


//-->
</style>


My problem is i need  something like this

            Username:________
            Password:________
                         
                           HouseNo1:___________
                                          HouseNo2:______________


How do i do,pls help?
0
Comment
Question by:Jasbir21
[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
4 Comments
 
LVL 31

Accepted Solution

by:
seanpowell earned 50 total points
ID: 9842236
You can adjust this to suit your needs, but this is the basic styling:

<html>
<head>
<title>Hello</title>
<style type="text/css">
<!--
form  {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 14px;
      color: #000000;
      }

input {
      width: 100px;
      }

label {
      float: left;
      width:100px;
      clear:all;
      padding-left:30px;
      }
   
//-->
</style>
</head>
<body>
<form>
<label for="username">Username:</label> <input type="text" name="username"><br />
<label for="password">Password:</label> <input type="text" name="password"><br />
<div style="width:100px; height:30px; float:left; padding:0px;"></div><span style="width:100px;">HouseNo1:</span> <input type="text" sixe="10" name="HouseNo1"><br />
<div style="width:204px; height:30px; float:left; clear:left;"></div><span style="width:100px;">HouseNo2:</span> <input type="text" sixe="10" name="HouseNo2"><br />
</form>
</body>
</html>
0
 

Author Comment

by:Jasbir21
ID: 9844364
thanks,i really panic, with the space.

Pls don't mind me asking something why put clear left; or clear=all;

and when put :

<div style="width:204px; height:30px; float:left; clear:left;"></div><span style="width:100px;">HouseNo2:</span>

if put div, then why span?

Very sorry me asking.

thanks
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9844980
No problem at all...

With the div and the span - the clear:left just makes sure that the "HouseNo2" line sits below the "HouseNo1" line. It means that the left edge of the div must be against the page margin (Their can't be anything to the left of it, so it simply moves down one line) clear:all will also do this, but since there's nothing on the right of it, clear:left will take care of it.

Here's the same form with background colors added to help you see what's happening:

<html>
<head>
<title>Hello</title>
<style type="text/css">
<!--
form  {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 14px;
      color: #000000;
      }

input {
      width: 100px;
      }

label {
      float: left;
      width:100px;
      padding-left:30px;
      background-color: #CCCCCC;
      }
   
//-->
</style>
</head>
<body>
<form>
<label for="username">Username:</label> <input type="text" name="username"><br />
<label for="password">Password:</label> <input type="text" name="password"><br />
<div style="width:100px; height:30px; float:left; padding:0px; background-color: #CCCCCC;"></div><span style="width:100px; background-color: #CCCCCC;">HouseNo1:</span> <input type="text" sixe="10" name="HouseNo1"><br />
<div style="width:204px; height:30px; float:left; clear:all; background-color: #CCCCCC;"></div><span style="width:100px; background-color: #CCCCCC;">HouseNo2:</span> <input type="text" sixe="10" name="HouseNo2"><br />
</form>
</body>
</html>

Play around with adding and removing parts of the code to soo how each attribute affects its layout.

Please feel free to comment back :-)

Thanks,
georgemarian
0
 

Author Comment

by:Jasbir21
ID: 9845318
hi,
  thank you so much, you have really made me understand what it means. I just want to say that i am very very grateful and thankful for being very very patient with me and really helping me to understand.
 
  May God bless you in everything that you do ..

Thank you again and God bless you.
0

Featured Post

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
need help with share buttons 11 106
Use Mid in Html 6 35
Popup write two lines 3 32
HTML editor custom button 3 88
This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
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.…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

739 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