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 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    22
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Question CSS problem (probably)

    my problem is that in some divs (all diws have the same code, same name) my text turn to the default color (declared in the CSS), and my question is why does this happen and how could i fix it.

    this is my site: http://siweb.co.nr/,
    and this is my included file that contains the divs whit the text: http://siweb.co.nr/FP_inc.html,
    and this is a link to my css file: http://siweb.co.nr/styles.css.

    please help me .

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    CSS allows for property inheritance. What this means is that here

    Code:
    body
    {
    
    	font: 12px Tahoma, Arial, Helvetica, sans-serif;
    	color: #003399;
    	background: #296FC0;
    }
    you have set the default color for all text. There is a hierarchy where the more specific you get with your declarations, the more specific you declare (instead of the entire document, you can set just one div with the id "left" as you have in your CSS but there is no div with that id?).

    So it looks like you have a lot of CSS that doesn't fit your markup.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • Users who have thanked gnomeontherun for this post:

    Neowulf (02-19-2009)

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello Neowolf,
    That site looks alright at 1024px wide but have you seen it at wider resolutions?
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    Neowulf (02-19-2009)

  • #4
    New Coder
    Join Date
    Jan 2009
    Posts
    22
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jeremywilken View Post
    CSS allows for property inheritance. What this means is that here

    Code:
    body
    {
    
    	font: 12px Tahoma, Arial, Helvetica, sans-serif;
    	color: #003399;
    	background: #296FC0;
    }
    you have set the default color for all text. There is a hierarchy where the more specific you get with your declarations, the more specific you declare (instead of the entire document, you can set just one div with the id "left" as you have in your CSS but there is no div with that id?).

    So it looks like you have a lot of CSS that doesn't fit your markup.
    yes i know that i had a default color declared in the styles.css, i was just wondering why did only specific divs content turn to default text, and yes i really should define only single divs not the entire page your right .

    thanks for your help jeremywilken

    Quote Originally Posted by Excavator View Post
    Hello Neowolf,
    That site looks alright at 1024px wide but have you seen it at wider resolutions?
    Hello Excavator
    i know im already working on it (that damn thing always slides to the left ), and thanks for your help Excavator

  • #5
    New Coder
    Join Date
    Jan 2009
    Posts
    22
    Thanks
    10
    Thanked 0 Times in 0 Posts
    i removed the body element from the css and colored the divs invidualy as yu said and the divs content at my page top got fixed, but the text content of my right div still turns blue.

    what should i do

  • #6
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    If it is an anchor tag (<a>) then you have to style them different from just regular text.

    You have a lot of errors in your markup, this is also a problem

    http://validator.w3.org/check?verbos...b.110mb.com%2F

    By the way why are you using Frames so much? I think they cause far too many problems and they are being phased out in HTML.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • Users who have thanked gnomeontherun for this post:

    Neowulf (02-22-2009)

  • #7
    New Coder
    Join Date
    Jan 2009
    Posts
    22
    Thanks
    10
    Thanked 0 Times in 0 Posts
    "Validation Output: 110 Errors " i have lot of work to do
    but the good news are that i finally fixed the right div thanks to you
    i did what you said (styled the anchor tag different) and it works
    (i havent uploaded the new css yet)

    this is the code i used:

    Code:
    #tilte_text a:link {color: #FFFFFF}
    
    #tilte_text {color: #FFFFFF}
    
    #tilte_text a:hover {color: #FFFFFF}
    
    #tilte_text a:active {color: #FFFFFF}
    
    #tilte_text
    {
    color: #FFFFFF;
    font-size: 20px;
    }
    thanks again jeremywilken


  •  

    Posting Permissions

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