Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts

    Unhappy Why won't these classes work

    OK. Ive got a problem with my inline styling. I am just messing around with a page, and practicing making a semantically correct page. For now, I am keeping any small amount of style necessary in the head. I will evetually export it to an external sheet. My problem is that som of my stylin is not taking effect in the browser, namley any tag that uses a class.

    CSS (just the tags that have problems)

    Code:
    p.login_text
    {
    font-family:Arial, Helvetica, sans-serif;
    font-size:8pt;
    color:#000066;
    }
    
    ul.login
    {
    list-style:none;
    float:left;
    }
    HTML (just where im having trouble)
    Code:
       <form action="login/login.php" method="post">
       <p class="login_text">
       <ul class="login">
    	<li>
    	Login
    	</li>
    	<li>
    	Username:
    	</li>   
    	<li>
    	<input type="text" name="username" />
    	</li>
    	<li>
    	Password:
    	</li>
    	<li>
    	<input type="password" name="password" />
    	</li>
    	<li>
    	<input type="submit" name="submit" value="Login"/>
    	</li>
       </ul>
       </p>  
       </form>
    Note: the UL:list-style:none; works, just not float:left. This is confusing, cause its choosing just some of the commands to use

    full code @: http://www.robowhizards.com/examples

    Dan
    Last edited by whizard; 02-18-2005 at 05:54 PM.
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #2
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Whizard,

    I changed "p.login_text" to "li.login_text" and added the class to the li tags.

    Code:
    <li class="login_text">
    	Username:
    	</li>
    I noticed that just adding the p tag around the list items did take the styling.

  • #3
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Thanx. Case closed.

    its kinda wierd, but I dont have time to wonder why.

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #4
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Hey Dan,

    It's because, unless you've declared the font style globally, uls have their own rules when it comes to text. So, if you declared font styles on a paragraph, and nested a ul in there, you'd have to redeclare the rules you wanted. You could actually just apply ALL of the styles above in the ul.login class and that'll be that.

    On another, sidetrack kinda note... this form isn't really meant to be in an unordered list. You can just use the form elements-- input, label, fieldset, etc-- to apply structure.

    Hope this helps,

  • #5
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Thanks! I always appreciate input into making my pages more semantically correct.

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

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