Solved

CSS Styling - Div Box and H1 Links

Posted on 2012-04-10
4
281 Views
Last Modified: 2012-04-19
I have h1 tags inside a div box (want the whole div box clickable) below and the h1 tag links have underlines and I am trying to get rid of them.  I am missing something here....

<a href="#">
     <div id="home-annoucement">
    	<h1 class="annoucement1">Open House </h1>
                 <h1 class="annoucement1">Today!</h1>
                 <h1 class="annoucement1">Click here for more information...</h1>
    </div><!-- home-annoucement -->
</a>

Open in new window



------------------------CSS-----------------

#home-annoucement {
	background-color: #FFC;
	padding: 4px;
	height: 70px;
	width: 880px;
	border: 1px solid #FC3;
	margin-left: 13px;
}

#home-annoucement h1 {
	font-size: 18px !important;
	color: #000 !important;
	margin: 0px !important;
	padding: 3px !important;
	text-align: center !important;
	text-decoration: none !important;
}

Open in new window

0
Comment
Question by:keith1001
  • 2
4 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 37829799
For class="annoucement1", 'annoucement1' is not the same as #home-annoucement h1 that you show above.  You need to find plain 'annoucement1' in your CSS.
0
 
LVL 16

Expert Comment

by:s8web
ID: 37829809
Do it like this instead:

    <div id="home-annoucement" onclick="location.href='http://www.wolframalpha.com/';" style="cursor:pointer;">
        <h1 class="annoucement1">Open House </h1>
        <h1 class="annoucement1">Today!</h1>
        <h1 class="annoucement1">Click here for more information...</h1>
    </div>
    <!-- home-annoucement -->

Open in new window

0
 
LVL 16

Expert Comment

by:s8web
ID: 37829825
Wrapping a div in an anchor tag like that isn't standards compliant and could cause you some headaches in the future.

The inline js in my example isn't very elegant and there are other methods, but it'll get the job done.
0
 
LVL 16

Accepted Solution

by:
HagayMandel earned 500 total points
ID: 37831051
The CSS:
<style type="text/css">
.annoucement1 {
	text-decoration: none;
	padding: 12px;
	background-color: #FFFFCC;
}
 #wrapper a {
	text-decoration: none;
}
</style>

Open in new window


The HTML:
<div id="wrapper"><a href="#">     
    <h1 class="annoucement1">Open House <br /> 
    Today!<br />Click here for more information...</h1>
</a></div>

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Wordpress themes CSS? 6 30
CSS Style 8 42
CSS in HTML 5 51
Hta File displays dynamic File names 4 43
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question