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
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    6
    Thanks
    2
    Thanked 1 Time in 1 Post

    Using CSS does anyone have any idea how to make a header a link and then place that l

    Using CSS does anyone have any idea how to make a header a link and then place that link/header in a paragraph and have everything look normal?...and validate.


    I have been fighting with this for hours.

    This is what I have so far it does not work

    Code:
    .pinline	{
    	display: inline;
    }
    .h2home {
    	text-transform: none;
    	color: #000;
    	font-style: normal;
    	font-size: 1em;
    	text-decoration:underline;
    	display: inline; 
    }
    .h2home A {
    	COLOR: #000;
    	text-decoration:none;
    	font-weight: normal;
    	font-size: 1em;
    	text-decoration:underline;
    	display: inline; 
    }
    .h2home A:hover   {
    	COLOR: #59AFE2;
    	text-decoration:underline;
    	font-weight: normal;
    	font-size: 1em;	
    	display: inline; 
    }
    Here is the html

    Code:
            <p class="pinline">Whether it’s 
            <h2 class="h2home"><a href="graphicdesign.html">brand marketing</a></h2> 
            or <h2 class="h2home"><a href="web.html">web development</a></h2>, as a premier Iowa design company we offer a wealth of skills, resources and talent. If you are searching for services internationally, nationally or locally you have come to the right place.</p> 
            <p class="pinline">Developing successful, solid, striking and userriendly 
            <h2 class="h2home"><a href="webdesign.html">websites</a></h2> is our specialty. To that end we will construct a <h2 class="h2home"><a href="mobile.html">mobile</a></h2> version of your website that is effortless to navigate. We offer you the ability to take control and update your <h2 class="h2home"><a href="cms.html">website content</a></h2> with relative ease. We’ve got your secure online E-Commerce
    store covered. <h2 class="h2home"><a href="custom.html">Custom applications</a></h2> or <h2 class="h2home"><a href="flash.html">Flash</a></h2>
     powered experiences, we can build it from the ground up
            <p>Utilizing <a href="social.html">social media tools</a>, <a href="analytics.html">web analytics</a>, <a href="seo.html">search engine optimization or marketing</u></a> your website will reach your target audience, in turn strengthening your bottom line. </p>

  • #2
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    What does the validator tell you your errors are?
    Teed

  • Users who have thanked teedoff for this post:

    mguise (11-04-2011)

  • #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 mguise,
    That is quite a bit of "tag soup" there. You cannot have a heading tag inside a paragraph tag. Try span in it's place.

    Instead of span, you can just put your class on the anchor itself. You can see I've done that in some of the links in this example.

    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 {background: #fc6;}
    #header {
    	width: 800px;
    	margin: 20px auto;
    	background: #ccc;
    }
    .pinline	{
    	display: inline;
    }
    .h2home {
    	text-transform: none;
    	color: #000;
    	font-style: normal;
    	font-size: 1em;
    	text-decoration:underline;
    	display: inline; 
    }
    .h2home A, a.h2home {
    	COLOR: #000;
    	text-decoration:none;
    	font-weight: normal;
    	font-size: 1em;
    	text-decoration:underline;
    	display: inline; 
    }
    .h2home A:hover, a.h2home:hover   {
    	COLOR: #59AFE2;
    	text-decoration:underline;
    	font-weight: normal;
    	font-size: 1em;	
    	display: inline; 
    }
    </style>
    </head>
    
    <body>
        <div id="header">
            <p class="pinline">
                Whether it's <span class="h2home"><a href="graphicdesign.html">brand marketing</a></span> 
                or <span class="h2home"><a href="web.html">web development</a></span>, as a premier Iowa 
                design company we offer a wealth of skills, resources and talent. If you are searching for 
                services internationally, nationally or locally you have come to the right place.
            </p> 
            <p class="pinline">
                Developing successful, solid, striking and userriendly <span class="h2home"><a href="webdesign.html">websites</a></span> 
                is our specialty. To that end we will construct a <span class="h2home"><a href="mobile.html">mobile</a></span> 
                version of your website that is effortless to navigate. We offer you the ability to take control and update your 
                <span class="h2home"><a href="cms.html">website content</a></span> with relative ease. We've got your secure online 
                E-Commerce store covered. <a href="custom.html" class="h2home">Custom applications</a> or <a href="flash.html" class="h2home">Flash</a>
                powered experiences, we can build it from the ground up
            </p>
            <p>
                Utilizing <a href="social.html">social media tools</a>, <a href="analytics.html">web analytics</a>, <a href="seo.html">
                search engine optimization or marketing</a> your website will reach your target audience, in turn strengthening your 
                bottom line. 
            </p>
        <!--end header--></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:

    mguise (11-04-2011)

  • #4
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    That is quite a bit of "tag soup" there. You cannot have a heading tag inside a paragraph tag.
    He mentioned "and validate" so I thought maybe he could figure out he had heading tags inside his paragraph tags.
    Teed

  • #5
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    6
    Thanks
    2
    Thanked 1 Time in 1 Post
    Thanks for the feedback. I agree, I created allot of soup trying to do something that does not validate. Next time I will pay closer attention to what W3C says.

    Again, always appreciative for the responses.


  •  

    Posting Permissions

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