7 Replies Latest reply on Jan 25, 2011 4:00 AM by mahendra rajeshirke

    a:hover vs :hover

    heazle Level 1

      I am new to dreamweaver could someone explain to me the difference between

      a:hover

      and

      hover

      or

      <a href= "about us.html"><"div id=about">About Us</a><div>

      and

      <href="about us.html"><"div id =about">about us</div>

        • 1. Re: a:hover vs :hover
          Ben M Adobe Community Professional

          heazle wrote:

           

          <a href= "about us.html"><"div id=about">About Us</a><div>

          and

          <href="about us.html"><"div id =about">about us</div>

          Not really much difference.  Neither is valid HTML.

           

          For #1:

          The <a> tag cannot encompass a <div> tag.

          The quotation mark before the "div is not valid and needs to be after the id=" before the word about.

           

          For #2

          <href> is not a valid HTML tag

          <href> has no ending tag after the </div>

           

          Only way to make it valid is to do:

           

          <div id="about"><a href="about_us.html">About Us</a></div>

          • 2. Re: a:hover vs :hover
            BenPleysier Adobe Community Professional & MVP
            Only way to make it valid is to do:

             

            <div id="about"><a href="about_us.html">About Us</a></div>

            What is wrong with

             

            <a href="about_us.html"><div id="about">About Us</div></a>

             

            Gramps

            • 3. Re: a:hover vs :hover
              Nancy OShea Adobe Community Professional & MVP
              What is wrong with

               

              <a href="about_us.html"><div id="about">About Us</div></a>

               

              Ben,

              Inlined-display elements go inside block-display elements; not vice versa.

               

              A block-display element will span the full width of the space available  to it, and so will start on a new line in the HTML flow. Example of block display elements:

              <div>
              <h1> … <h6>
              <hr>
              <p>
              <ul>, <ol>, <dl>
              <li>, <dt>, <dd>
              <table>
              <blockquote>
              <pre>
              <form>

              Inline-display elements don’t break the flow. They fit inside the flow of the document. Example of inline-display elements.
              <span>
              <a>
              <strong>
              <em>
              <img />
              <br>
              <input>
              <abbr>

               

               

              Nancy O.
              Alt-Web Design & Publishing
              Web | Graphics | Print | Media  Specialists
              http://alt-web.com/
              http://twitter.com/altweb

              • 4. Re: a:hover vs :hover
                BenPleysier Adobe Community Professional & MVP

                Hi Nancy,

                 

                Thank you for taking your time to answer.

                 

                I have been advocating the migration to HTML5 and I guess this is one of the many reasons. Please have a look here http://html5doctor.com/block-level-links-in-html-5/

                 

                Gramps

                • 5. Re: a:hover vs :hover
                  osgood_ Level 8

                  altruistic gramps wrote:

                   

                  Hi Nancy,

                   

                  Thank you for taking your time to answer.

                   

                  I have been advocating the migration to HTML5 and I guess this is one of the many reasons. Please have a look here http://html5doctor.com/block-level-links-in-html-5/

                   

                  Gramps

                   

                  You're going to keep tripping people up with this one, keep it going

                   

                  Is pretty weird that the WC3 now do a complete U-Turn. You have to question validation. I mean if you don't use an html5 doctype it won't validate but it will still work............so how important is validation, not very..........something I've been saying for years.

                  • 6. Re: a:hover vs :hover
                    BenPleysier Adobe Community Professional & MVP
                    You have to question validation

                    How true!

                     

                    This opens a real can of worms. These guys that determine what is and isn't valid need to become more realistic. I think it is true that there is a  need for validation, I also think that browsers should be more answerable to the standards set by W3C. But as long as it is a mess and browser producers apply their proprietory cuteness, plain one-sided validation is a laugh.

                     

                    Gramps

                    • 7. Re: a:hover vs :hover
                      mahendra rajeshirke Level 2

                      @Inlined-display elements go inside block-display elements; not vice versa.

                       

                      there is a attribute in css "display:block;" we can convert inline elements into block level by using this attribute, cant we?

                       

                       

                      Nancy O. wrote:

                       

                      What is wrong with

                       

                      <a href="about_us.html"><div id="about">About Us</div></a>

                       

                      Ben,

                      Inlined-display elements go inside block-display elements; not vice versa.

                       

                      A block-display element will span the full width of the space available  to it, and so will start on a new line in the HTML flow. Example of block display elements:

                      <div>
                      <h1> … <h6>
                      <hr>
                      <p>
                      <ul>, <ol>, <dl>
                      <li>, <dt>, <dd>
                      <table>
                      <blockquote>
                      <pre>
                      <form>

                      Inline-display elements don’t break the flow. They fit inside the flow of the document. Example of inline-display elements.
                      <span>
                      <a>
                      <strong>
                      <em>
                      <img />
                      <br>
                      <input>
                      <abbr>

                       

                       

                      Nancy O.
                      Alt-Web Design & Publishing
                      Web | Graphics | Print | Media  Specialists
                      http://alt-web.com/
                      http://twitter.com/altweb