Results 1 to 6 of 6

Thread: Css help for a form

  1. #1
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default Css help for a form

    Hi,

    I try to create a right to left form without using any tables,
    but I don't know where to start.

    This is the structure of what I'm looking for:



    I'll really appreciate any kind of help!

  2. #2
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default

    here you go..

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Float left</title>
    <style>
    li{
    float:left;
    list-style:none;
    padding-left:10px; <!--to make space between li-->
    }
    </style>
    </head>
    
    <body>
    <ul>
    	<li><input type="button" value="Button"/></li>
        <li><input type="button" value="Button"/></li>
      	<li><input type="text" /></li>
        <li><input type="text" /></li>
    </ul>
    </body>
    </html>
    good luck...

  3. The Following User Says Thank You to davelf For This Useful Post:

    d-machine (09-08-2009)

  4. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by davelf View Post
    here you go..

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Float left</title>
    <style>
    li{
    float:left;
    list-style:none;
    padding-left:10px; <!--to make space between li-->
    }
    </style>
    </head>
    
    <body>
    <ul>
    	<li><input type="button" value="Button"/></li>
        <li><input type="button" value="Button"/></li>
      	<li><input type="text" /></li>
        <li><input type="text" /></li>
    </ul>
    </body>
    </html>
    good luck...
    You forgot the text information

    HTML Code:
    <style>
    fieldset ul {list-style-type:none}
    fieldset ul li {display:inline; position:relative}
    fieldset ul li label {position:absolute; top:100%; right:0}
    </style>
    
    <form>
    <fieldset>
    	<legend></legend>
        <ul>
            <li><input type="button" name="" value=""></li>
            <li><input type="button" name="" value=""></li>
            <li><input type="text" name="input1" id="input1" value=""> <label for="input1">TEXT</label></li>
            <li><input type="text" name="input2" id="input2" value=""> <label for="input2">TEXT</label></li>
        </ul>
    </fieldset>
    </form>

  5. #4
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    When I add this to my html, it seems to work in IE, FF and Opera but with Chrome it makes some problems, it is breaking the line for some reason:

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <
    html xmlns="http://www.w3.org/1999/xhtml">
    <
    head>
    <
    meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <
    title>Trial</title>
    <
    style type="text/css">

    body {
        
    background-image:url(http://www.westciv.com/style_master/house/tutorials/quick/rising_tide/images/header-background.jpg);
        
    background-position:center;
        
    background-repeat:repeat;
        
    padding:0;
        
    margin:0;
        
    font-family:ArialHelveticasans-serif;
        
    text-align:center;
    }

    #pictureline {
        
    background-image:url(http://i.telegraph.co.uk/telegraph/multimedia/archive/00995/olazabal_995959c.jpg);
        
    background-repeat:repeat-x;
        
    height:9px;
        
    width:100%;
        
    position:absolute;
        
    top:63px;
        
    z-index:1;
    }

    #myhead {
        
    position:absolute;
        
    text-align:left;
        
    z-index:2;
        
    width:970px;
        
    padding:0;
    }

    #myhead ul{
        
    color:#8B8B8B;
        
    font-size:12px;
        
    margin0;
        
    padding0;
        
    floatleft;
        
    height:111px;
    }

    #myhead ul li{
         
    list-style-typenone;
         
    displayinline;
         
    vertical-align:text-top;
    }

    #header{
        
    background-color:#000000;
        
    height:63px;
        
    width:100%;
        
    z-index:1;
        
    padding:0;
        
    margin:0;
    }

    .
    black {
        
    margin:0 auto;
        
    width970px;
    }

    li.loginform{
        
    padding:15px 0 0 0;
        
    position:absolute;
        
    width648px;
        
    text-align:right;
    }

    #username, #password{
        
    background-color#242424;
        
    border1px solid #50514D;
        
    width140px;
        
    height22px;
        
    color:#F3F3F1;
        
    font-size14px;
        
    vertical-align4px;
        
    margin:0;
        
    padding:3px 7px 0 0;
    }

    .
    but{
        
    background-color:#06F;
        
    color:#FFFFFF;
        
    font-family:ArialHelveticasans-serif;
        
    font-size:14px;
        
    width:94px;
        
    height:28px;
        
    border:0px solid #ffffff;
    }

    fieldset ul {list-style-type:none}
    fieldset ul li {display:inlineposition:relative}
    fieldset ul li label {position:absolutetop:100%; right:0}

    </
    style>
    </
    head>

    <
    body>
    <
    div class="black">

    <
    div id="myhead">
    <
    ul>
     <
    li><a href="http://loud.co.il"><img src="http://fineartamerica.com/images-medium/vanishing-landscpae-david-howells.jpg" alt="" border="0" width="320" height="111" /></a></li>
     <
    li class="loginform" dir="rtl">
     <
    form action="">
    <
    fieldset>
        <
    legend></legend>
        <
    ul>
            <
    li><input type="button" name="" value="Enter" /></li>
            <
    li><input type="button" name="" value="Exit" /></li>
            <
    li><input type="text" name="input1" id="input1" value="" /> <label for="input1">Class</label></li>
            <
    li><input type="text" name="input2" id="input2" value="" /> <label for="input2">Type</label></li>
        </
    ul>
    </
    fieldset>
     </
    form>
     </
    li>
    </
    ul>

    </
    div>
    </
    div>

    <
    div id="header">
    </
    div>
    <
    div id="pictureline">
    </
    div>

    </
    body>
    </
    html
    and another small question, how can I remove the fieldet border?


    In the end I want it to look like this:




    Thanks again!

  6. #5
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    how can I remove the fieldet border?
    Code:
    fieldset {border-width:0}
    When I add this to my html, it seems to work in IE, FF and Opera but with Chrome it makes some problems, it is breaking the line for some reason:
    what exactly does it do... "it doesn't work" doesn't help us debug and troubleshoot for you.

  7. #6
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default

    Hi thanks for the border
    Last edited by d-machine; 09-09-2009 at 04:07 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •