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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 26

Thread: How to Hide Css

  1. #1
    New Coder
    Join Date
    Nov 2011
    Location
    England
    Posts
    64
    Thanks
    10
    Thanked 3 Times in 3 Posts

    How to Hide Css

    Hi
    i'm sorry if this has been posted here before but i'm new to the forums. i'm currently working in Dreamweaver and have attached a css document to my webpages however every time i look at my pages in the browser, the css shows at the top of the page above my actual design, does anybody know how to stop this from happening?
    thanks
    Adam

  • #2
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,805
    Thanks
    41
    Thanked 199 Times in 198 Posts
    can't... see here

    Edit:unless you mean <link>-ing it. but if trying to hide it so no one can get it see above

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #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 designer21,
    That sounds like your document is not formed correctly. You are likely missing a closing tag or something.
    You could post the entire code here for us to look at, use the code tags, &#91;code&#93;&#91;/code&#93; or you could run your code through the validator and likely fix it yourself.

    See the links about validation in my signature line below.




    ...
    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:

    designer21 (11-03-2011)

  • #4
    New Coder
    Join Date
    Nov 2006
    Posts
    21
    Thanks
    3
    Thanked 1 Time in 1 Post
    Hi Adam,

    This might just be a problem with unclosed tags. To use an external style sheet, make sure the code is correct...

    In the web page, link to the style sheet:

    Code:
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="styles\style.css" />
    </head>
    <body>
    
    </body>
    </html>
    Inside the style.css file, make sure your declarations are in this format:

    Code:
    body { 
    background-color: beige; 
    font-family: Arial; 
    font-size: 14px; 
    color: black; 
    }
    
    h1 {  
    font-size: 16px; 
    }
    
    h2 { 
    font-size: 14px; 
    }
    
    a { 
    text-decoration: none; 
    }
    
    a:hover { 
    text-decoration: underline; 
    }
    
    ul { 
    list-style-type: none; 
    padding: 0%; 
    }
    
    img { 
    border: 0px; 
    }
    ...etc.

  • Users who have thanked Subyne Simean for this post:

    designer21 (11-03-2011)

  • #5
    New Coder
    Join Date
    Nov 2011
    Location
    England
    Posts
    64
    Thanks
    10
    Thanked 3 Times in 3 Posts
    thank you for your help so far, i've tried validating however it says there are errors, and my css is already laid out like that,
    here is the code that i have at the top of the page, please feel free to check it out and tell me what i've done wrong

    <head>
    <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
    <title>doodledesign - index</title>
    <meta http-equiv="Content-Language" content="en-us" />

    <meta http-equiv="imagetoolbar" content="no" />
    <meta name="MSSmartTagsPreventParsing" content="true" />

    <meta name="description" content="Description" />
    <meta name="keywords" content="Keywords" />

    <meta name="author" content="Doodle Design" />

    <style type="text/css" media="all">@import "file:///Macintosh HD/Users/Danny/Desktop/design-website/css/main.css";</style> <style type="text/css" media="all">@import "file:///Macintosh HD/Users/Danny/Desktop/design-website/css/main.css";</style>
    </head>

    cheers again

  • #6
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by designer21 View Post
    thank you for your help so far, i've tried validating however it says there are errors, and my css is already laid out like that, ...
    Yes, the errors found by the validator are what you need to fix.

    Quote Originally Posted by Excavator View Post
    You could post the entire code here for us to look at, use the code tags, &#91;code&#93;&#91;/code&#93;


    ...
    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

  • #7
    New Coder
    Join Date
    Nov 2011
    Location
    England
    Posts
    64
    Thanks
    10
    Thanked 3 Times in 3 Posts
    sorry it's suppose to say, there was no errors when i validated it.

    Code:
        <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
        <title>doodledesign - index</title>
        <meta http-equiv="Content-Language" content="en-us" />
         
        <meta http-equiv="imagetoolbar" content="no" />
        <meta name="MSSmartTagsPreventParsing" content="true" />
         
        <meta name="description" content="Description" />
        <meta name="keywords" content="Keywords" />
         
        <meta name="author" content="Doodle Design" />
         
        <style type="text/css" media="all">@import "css/main.css";</style>  <style type="text/css" media="all">@import "css/main.css";</style>

  • #8
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    That little snippet you keep posting is not near enough information for us to figure out what the problem is. That's why I keep asking for your entire code. A link to the test site would be best.
    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

  • #9
    New Coder
    Join Date
    Nov 2011
    Location
    England
    Posts
    64
    Thanks
    10
    Thanked 3 Times in 3 Posts
    i'm sorry, i'm being old fashioned and making the site using tables instead of divs so sorry for it being basic. urmm i'll give you all the code i've got now on here.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
        <title>doodledesign - portfolio</title>
        <meta http-equiv="Content-Language" content="en-us" />
         
        <meta http-equiv="imagetoolbar" content="no" />
        <meta name="MSSmartTagsPreventParsing" content="true" />
         
        <meta name="description" content="Description" />
        <meta name="keywords" content="Keywords" />
         
        <meta name="author" content="Enlighten Designs" />
         
        <style type="text/css" media="all">
        </style>  <style type="text/css" media="all">
        </style>
    <link href="css/main.css" rel="stylesheet" type="text/css" />
    </head>
     
    <body>
    <table width="760" border="0" align="center">
      <tr>
        <td width="210" height="145" rowspan="2"><img src="images/layout-images/logo.png" width="210" height="145" /></td>
        <td width="550" height="95">&nbsp;</td>
      </tr>
      <tr>
        <td width="550" height="50" class="nav"><table width="550" border="0">
          <tr>
            <td height="50">&nbsp;</td>
            <td width="100" align="center" valign="bottom"><a href="index.html" class="nav">HOME</a></td>
            <td width="100" align="center" valign="bottom"><a href="portfolio.html" class="nav">PORTFOLIO</a></td>
            <td width="100" align="center" valign="bottom">CONTACT US</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="5" colspan="2"><img src="images/layout-images/break-bar.png" width="760" height="5" /></td>
      </tr>
      <tr>
        <td height="440" colspan="2"><table width="760" border="0">
          <tr>
            <td width="210"><table width="210" border="0">
              <tr>
                <td width="210" height="110">&nbsp;</td>
              </tr>
              <tr>
                <td width="210" height="110">&nbsp;</td>
              </tr>
              <tr>
                <td width="210" height="110">&nbsp;</td>
              </tr>
              <tr>
                <td width="210" height="110">&nbsp;</td>
              </tr>
            </table></td>
            <td width="550" height="440">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="5" colspan="2"><img src="images/layout-images/break-bar.png" width="760" height="5" /></td>
      </tr>
      <tr>
        <td height="75" colspan="2">&nbsp;</td>
      </tr>
    </table>
    </body>
    </html>
    sorry if i'm being difficult i've never used this forum before, i am sorry

  • #10
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by designer21 View Post
    sorry if i'm being difficult i've never used this forum before, i am sorry
    No worries
    I can't see any reason for your CSS to show up in your browser with what you've given us so far. Post your main.css too so we can see if there are any problems there.
    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

  • #11
    New Coder
    Join Date
    Nov 2011
    Location
    England
    Posts
    64
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Code:
    /* CSS Document */
    <style type='text/css'>
     TextRollover-1 
    a:link { color:#FFCC00; text-decoration:underline}
    a:visited { color:#FFCC00; text-decoration:underline;}
    a:hover { color:#FFFFFF; text-decoration:underline;}
    a:active { color:#FFCC00; text-decoration:underline}
    
    .main_text {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	font-style: normal;
    	line-height: 16px;
    }
    
    
    body {
    	background-color: #FFFFFF;
    	background-position: 0px 0px;
    	margin-left: 0px;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    }
    
    
    .Copyright {color: #FFFFFF}
    
    </style>
    h1 {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 20px;
    	line-height: 24px;
    	font-weight: normal;
    	color: #0066cc;
    }
    h2 {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 16px;
    	line-height: 16px;
    	font-weight: bold;
    	color: #990099;
    }
    h3 {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	line-height: 16px;
    	font-weight: bold;
    	color: #990099;
    }
    .INTRO {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 16px;
    	line-height: 20px;
    	color: #990099;
    }
    .TITLE {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 20px;
    	line-height: 24px;
    	font-weight: bold;	
    	color: #0066cc;
    }
    .caption {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	font-style: italic;
    	line-height: 16px;
    	color: #000000;
    }
    a.nav:link {
    	font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
    	font-size: 16px;
    	line-height: 16px;
    	color: #C1272D;
    	text-decoration: bold;
    }
    a.nav:visited {
    	font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
    	font-size: 16px;
    	line-height: 16px;
    	color: #C1272D;
    	text-decoration: bold;
    }
    a.nav:hover {
    	font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
    	font-size: 16px;
    	line-height: 16px;
    	color: #C1272D;
    	text-decoration: bold;
    }
    a.nav:active {
    	font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
    	font-size: 16px;
    	line-height: 16px;
    	color: #C1272D;
    	text-decoration: bold;
    	font-weight: bold;
    }
    a.nav1:link {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	line-height: 16px;
    	color: #0066cc;
    	text-decoration: underline;
    }
    a.nav1:visited {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	line-height: 16px;
    	color: #0066cc;
    	text-decoration: underline;
    }
    a.nav1:hover {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	line-height: 16px;
    	color: #990099;
    	text-decoration: underline;
    }
    a.nav1:active {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	line-height: 16px;
    	color: #FFFFFF;
    	text-decoration: underline;
    }
    a.h1nav:link {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 20px;
    	line-height: 24px;
    	color: #0066cc;
    	text-decoration: none;
    }
    a.h1nav:visited {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 20px;
    	line-height: 24px;
    	color: #0066cc;
    	text-decoration: none;
    }
    a.h1nav:hover {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 20px;
    	line-height: 24px;
    	color: #0066cc;
    	text-decoration: none;
    }
    a.h1nav:active {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 20px;
    	line-height: 24px;
    	color: #0066cc;
    	text-decoration: none;
    }
    .sub-head-italic {
    	font-family: Times, serif;
    	font-size: 16px;
    	line-height: 16px;
    	font-weight: bold;
    	color: #990099;
    	font-style: italic;
    
    }
    .sign-off {
    	font-family: Times, serif;
    	font-size: 14px;
    	line-height: 16px;
    	font-weight: bold;
    	color: #0066cc;
    	font-style: italic;
    }
    .sub-head {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	line-height: 16px;
    	font-weight: bold;
    	color: #000066;
    }
    .white_text {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	font-style: normal;
    	line-height: 16px;
    	color: #FFFFFF;
    }
    .background01 {
    	background-attachment: fixed;
    	background-image: url(../images/nursery-cleaning-specialists-bg1.jpg);
    	background-repeat: repeat;
    	background-position: center top;
    }
    .background02 {
    	background-attachment: fixed;
    	background-image: url(../images/nursery-cleaning-specialists-bg2.jpg);
    	background-repeat: repeat;
    	background-position: center top;
    }
    thank you so much for your help

  • #12
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Doesn't look like anything wrong there either.
    The only things I do see odd is the snippet you posted has the CSS being imported but the entire code you posted has a linked css file. Could it be some version control issues?
    Make sure the latest edits of your code are what your using and that your browser is not caching an earlier version.

    Other than that, once I finally got all the code and put it together here locally ... the CSS does not display on the rendered website.
    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

  • #13
    New Coder
    Join Date
    Nov 2011
    Location
    England
    Posts
    64
    Thanks
    10
    Thanked 3 Times in 3 Posts
    sorry, please could you show me the code for the bit you thought was odd

  • #14
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,775
    Thanks
    6
    Thanked 1,021 Times in 994 Posts
    Well, looks like you’ve overseen somethin, Excavator:
    Code:
    /* CSS Document */
    <style type='text/css'>
     TextRollover-1 
    a:link { color:#FFCC00; text-decoration:underline}
    a:visited { color:#FFCC00; text-decoration:underline;}
    a:hover { color:#FFFFFF; text-decoration:underline;}
    a:active { color:#FFCC00; text-decoration:underline}
    
    .main_text {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	font-style: normal;
    	line-height: 16px;
    }
    
    
    body {
    	background-color: #FFFFFF;
    	background-position: 0px 0px;
    	margin-left: 0px;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    }
    
    
    .Copyright {color: #FFFFFF}
    
    </style>
    designer21, the code I highligted in red is HTML (or at least not CSS) which doesn’t belong in a stylesheet.

  • Users who have thanked VIPStephan for this post:

    designer21 (11-03-2011)

  • #15
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by VIPStephan View Post
    Well, looks like you’ve overseen somethin, Excavator:
    I did see that. It does not seem to be causing his problem though.
    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


  •  
    Page 1 of 2 12 LastLast

    Tags for this Thread

    Posting Permissions

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