Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8307511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:32:24+00:00 2026-06-08T18:32:24+00:00

Hi HTML5 / css guru’es I’m trying to make use of some new features

  • 0

Hi HTML5 / css guru’es

I’m trying to make use of some “new” features presented by HTML5 however I have stumpled uppon a problem with changing my links background on hover when having block elements inside the tag.

This is my test code:

<!doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <title>teeeest</title>
    <link rel="stylesheet" href="saninetto1/css/bootstrap.min.css" />
    <style>
        a:link  { background-color: red; }
        a:hover { background-color: #333; }
    </style>
</head>

<body>
        <div><a href="#">I'm a block</a></div><br />
        <a href="#2"><div>I'm a block 2</div></a>
    </body>
</html>

According to html5doctor (article) it should be straight forward but I just can’t change the background on when hovering.

I made this fiddle to show the difference when using my test html: http://jsfiddle.net/vJEEn/

As the fiddle shows I can make changes to the text, but not the background-color

hope you can help me changing the background on hover

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:32:25+00:00Added an answer on June 8, 2026 at 6:32 pm

    Add this CSS property in your code.

    a { display: block;}
    

    I think thats what you are looking for.

    test code

    better options:

    a { display: inline-block;}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to learn and use html5 and have a basic layout but
Which TVs (brand/marks) can be programmed with use of the JavaScript/HTML5/CSS? We are doing
If I have a HTML element <header> and apply some margins to this HTML5
HTML5 introduces some nice new elements, <canvas> , <audio> , and <video> , that
I am building an phonegap app using html5 and css. I have a iBall
I am using html5, css, jquery mobile to develop some application. But the html
I updated some of my CSS styles to use normalize.css recently but discovered an
I was intending to use Eric Meyer's CSS reset but I stumbled in some
Im new at HTML/CSS and i would like to start directly at HTML5 so
I have a very nice web app (HTML5, javascript,CSS) running on my website. It's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.