Solved

CSS Styling - Div Box and H1 Links

Posted on 2012-04-10
4
272 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 82

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
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.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now