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

Thread: Invisible text

  1. #1
    New Coder
    Join Date
    Feb 2009
    Location
    Norway, Europe
    Posts
    94
    Thanks
    12
    Thanked 2 Times in 2 Posts

    Invisible text

    So. I was using a guide (HTMLdog) and it said that in order to make text invisible you could use:

    Code:
    width: 0;
    height: 0;
    overflow: hidden;
    however, this CSS program I'm using sais that 'overflow' isn't valid? How come?

  • #2
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    It may depend on the Doctype that you are using.
    Giving us the full code would be much more helpful.

    Look here for help.

    and here too.

    Frank
    Last edited by effpeetee; 03-01-2009 at 06:32 PM.
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • #3
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    The CSS programme is probably outdated or written to follow very basic rules. What is it?

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello DarkLightA,
    In that tutorial you're following doesn't explain a lot of things. It would be written like this to affect the only block level element that tutorial mentions:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    	font: 12px "Comic Sans MS";
    	background: #FC6;
    	text-align: center;
    }
    * {
    	margin: 0;
    	padding: 0;
    	border: none;
    }
    #wrap {
    	width: 800px;
    	margin: 30px auto;
    	background: #999;
    	overflow: auto;
    }
    #header {
    	width: 0;
    	height: 0;
    	overflow: hidden;
    }
    </style>
    </head>
    <body>
        <div id="wrap">
            <div id="header">     
                <h1>The Heading</h1>     
                	<a href="#content" accesskey="n">Skip navigation</a> 
            </div> 
        <!--end wrap--></div>
    </body>
    </html>
    But that does away with your whole header... probably not what you had in mind.
    If you make the link a block level element, then you can hide it the same way we hid #header. Like this:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    	font: 12px "Comic Sans MS";
    	background: #FC6;
    	text-align: center;
    }
    * {
    	margin: 0;
    	padding: 0;
    	border: none;
    }
    #wrap {
    	width: 800px;
    	margin: 30px auto;
    	background: #999;
    	overflow: auto;
    }
    #header {
    	height: 100px;
    	background: #F90;
    }
    #header a {
    	width: 0;
    	height: 0;
    	overflow: hidden;
    	display: block;
    }
    </style>
    </head>
    <body>
        <div id="wrap">
            <div id="header">     
                <h1>The Heading</h1>     
                	<a href="#content" accesskey="n">Skip navigation</a> 
            </div> 
        <!--end wrap--></div>
    </body>
    </html>
    I know, seems pretty funny to make your link display so we can hide it.
    You should complain to htmldog about the half assed tutorial.
    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:

    DarkLightA (03-01-2009)

  • #5
    New Coder
    Join Date
    Feb 2009
    Location
    Norway, Europe
    Posts
    94
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Thanks a lot Excavator. The display: block; hid it

    Btw. CyanLight: I'm using TopStyle Pro, so I find it kind of odd..

    Anyways, now it works, so I'm happy


  •  

    Posting Permissions

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