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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Location
    Bellaire, MI
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    inline img href drops a line in firefox

    Hey folks,

    I have a series of news pieces, each of which is followed by a small arrow that users can click to get to the article. The arrow is an html image added as part of a <p> and an <a href>. In CSSEdit the arrow lines up with the last line of the text. In Safari it does the same. In Firefox (2.0.0.11) it moves down a line. Any ideas why?

    HTML:

    <!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" xml:lang="en" lang="en">

    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <title>Home Page | Institute for Sustainable Living, Art &amp; Natural Design [ISLAND]</title>
    <link rel="stylesheet" media="screen" type="text/css" href="errortest1.css" />

    </head>

    <body>

    <div class="testcontainer">
    <a href="newsletters.html"><img src="newsletters.png" alt="newsletters" /></a>

    <h1><a href="newsletters.html">ISLAND Newsletters</a></h1>
    <p>Check out our archive of past newsletters and subscribe to receive monthly emails and/or biannual print news (it's free!)<a href="newsletters.html"><img src="littlearrow.png" alt="[GO]" /></a></p>

    <div class="spacer"></div>
    </div>

    </body>
    </html>

    CSS:

    h1, p {
    font-size: 100%;
    font-weight: normal;
    }

    img {
    border: none;
    }

    .testcontainer {
    margin: 20px;
    }

    .testcontainer img {
    float: left;
    clear: left;
    margin: 0 0 10px 0;
    }

    .testcontainer p a img {
    width: 1em;
    clear: none;
    float: right;
    margin: 0 1em 0 0;
    }

    .testcontainer p a:hover img {
    background: #ccf;
    }

    .testcontainer h1 a{
    font-weight: bold;
    font-size: 1em;
    margin: 0 0 0 20px;
    }

    .testcontainer p {
    color: #333;
    font-size: 1em;
    line-height: 1.4em;
    margin: 0 0 0 95px;
    }

    .testcontainer a:link, .newspiece a:visited {
    color: #900;
    text-decoration: none;

    }

    .testcontainer a:hover, .newspiece a:active {
    text-decoration: underline;
    color: #900;
    }

    .spacer {
    clear: both;
    }

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,692
    Thanks
    22
    Thanked 1,830 Times in 1,814 Posts
    Hello chazfort,
    A link to a test site would be nice for this... or at least send us littlearrow.png.
    Kind of hard to tell what's making it drop when we can't see it.

    When you say "it moves down a line" do you mean it makes a line break or is the image the only thing that moves down?

    Try giving littlearrow.png a class and position it with margins... maybe even float it?
    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

  • #3
    New to the CF scene
    Join Date
    Dec 2007
    Location
    Bellaire, MI
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Sure:

    http://www.artmeetsearth.org/test/errortest1.html

    the image stays one line below the text, rather than lining up evenly with it.

    Thanks for looking!

    CF

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,692
    Thanks
    22
    Thanked 1,830 Times in 1,814 Posts
    Quote Originally Posted by chazfort View Post
    the image stays one line below the text, rather than lining up evenly with it.
    Yup, that's exactly what you told it to do.

    Try this instead - copy/paste into a new test.html:
    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" xml:lang="en" lang="en">
    <head>
      <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
      <title>Home Page | Institute for Sustainable Living, Art &amp; Natural Design [ISLAND]</title> 
    <style type="text/css">
    html, body {
    	background: #ccc;
    }
    * {
    	margin: 0;
    	padding: 0;
    }
    img {
    	border: none;
    }
    .testcontainer {
    	width: 800px;
    	margin: 100px auto;
    	margin: 20px;
    	overflow: auto;
    	background: #66CCCC;
    }
    .testcontainer img {
    	float: left;
    	clear: left;
    	margin: 0 0 10px 0;
    }
    .testcontainer .go {
    	clear: none;
    	float: right;
    	margin: 0 1em 0 0;
    }
    .testcontainer .go:hover {
    	background: #ccf;
    }
    .testcontainer h1 a{
    	font-weight: bold;
    	font-size: 1em;
    	margin: 0 0 0 20px;
    }
    .testcontainer p {
    	color: #333;
    	font-size: 1em;
    	line-height: 1.4em;
    	margin: 0 0 0 95px;
    }
    .testcontainer a:link, .newspiece a:visited {
    	color: #900;
    	text-decoration: none;	
    }
    .testcontainer a:hover, .newspiece a:active {
    	text-decoration: underline;
    	color: #900;
    }
    h1, p {
    	font-size: 100&#37;;
    	font-weight: normal;
    }
    </style>
    </head>
    <body>  
    <div class="testcontainer">
        <a href="http://www.artmeetsearth.org/test/newsletters.html"><img src="errortest1_files/newsletters.png" alt="newsletters"></a>
            <h1><a href="http://www.artmeetsearth.org/test/newsletters.html">ISLAND Newsletters</a></h1>
                <p>
                    <img src="errortest1_files/littlearrow.png" alt="[GO]" width="20" height="20" class="go" /></a>
                	Check out our archive of past newsletters and subscribe to receive monthly emails 
                    and/or biannual print news (it's free!)<a href="http://www.artmeetsearth.org/test/newsletters.html">
                </p>
    </div>
    </body>
    </html>
    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:

    chazfort (01-06-2008)

  • #5
    New to the CF scene
    Join Date
    Dec 2007
    Location
    Bellaire, MI
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Allright! I'm not sure exactly why moving the image up a line in the html and changing the way that the CSS finds it worked, but it worked like a charm! Thanks!

  • #6
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,692
    Thanks
    22
    Thanked 1,830 Times in 1,814 Posts
    Quote Originally Posted by chazfort View Post
    Allright! I'm not sure exactly why moving the image up a line in the html and changing the way that the CSS finds it worked, but it worked like a charm! Thanks!
    Floats come first. Before the content that is supposed to be next to them. The float has to make room for itself before the text gets 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


  •  

    Posting Permissions

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