Solved

CSS - Placing an Image over a Header

Posted on 2011-09-08
2
188 Views
Last Modified: 2012-05-12
Hi Folks,

I have a H2 Header with a 3px Border at the bottom that stretches the full width of the page.  On the right-hand side I'm trying to place 6 small transparent images.  The positioning of these is fine at the moment, however the H2 border is being cut off (see image attached).  I've tried increasing the bottom-margin of the images, without success.

I've attached my CSS & HTML Code below (or rather, snippets of).

At this point, I'm slightly at a loss of which direction to take, so any pointers much appreciated!

 
/* CSS */

article .article-container {
	display:block;
	overflow:hidden;
}
article header {
	height:27px;
	border-bottom:3px solid;
	padding-bottom:8px;
	margin-bottom:20px;
}
article header h2 {
	font-size:167%;
	float:left;
}
article header nav { float:right; }

.social { border:none; }

/* HTML */

<div class="article-container">
<header>
<h2>H2 Header</h2>
					
<nav>
<a href=""><img src="/img/social/email.png" class="social" rel="tooltip" title="Email to a Friend"></a>
<a href=""><img src="/img/social/rss.png" class="social" rel="tooltip" title="RSS Feed"></a>
<a href=""><img src="/img/social/twitter.png" class="social" rel="tooltip" title="Tweet This"></a>
<a href=""><img src="/img/social/facebook.png" class="social" rel="tooltip" title="Post to Facebook"></a>
<a href=""><img src="/img/social/google.png" class="social" rel="tooltip" title="Post to Google+"></a>
<a href=""><img src="/img/social/delicious.png" class="social" rel="tooltip" title="Bookmark with Delicious"></a>
</nav>
</header>
</div>

Open in new window

Screenshot
0
Comment
Question by:RedBullLee
2 Comments
 
LVL 16

Accepted Solution

by:
SSupreme earned 500 total points
ID: 36506060
Try this:
<html>
<head>
<style type="text/css">
article .article-container {
	display:block;
	overflow:hidden;
}
article header {
	height:27px;
	border-bottom:3px solid;
	padding-bottom:8px;
	margin-bottom:20px;
}
article header h2 {
	font-size:167%;
	float:left;
}
article header nav { float:right; }

.social { border:none; }
header, h2, nav {margin:0;padding:0;}
header {width:900px;border-bottom:3px solid grey; overflow:hidden;}
h2 {width:500px; float:left;}
nav {width:200px;float:right;}
</style>
</head>

<body>


<div class="article-container">
<header>
<h2>H2 Header</h2>
					
<nav>
<a href=""><img src="/img/social/email.png" class="social" rel="tooltip" title="Email to a Friend"></a>
<a href=""><img src="/img/social/rss.png" class="social" rel="tooltip" title="RSS Feed"></a>
<a href=""><img src="/img/social/twitter.png" class="social" rel="tooltip" title="Tweet This"></a>
<a href=""><img src="/img/social/facebook.png" class="social" rel="tooltip" title="Post to Facebook"></a>
<a href=""><img src="/img/social/google.png" class="social" rel="tooltip" title="Post to Google+"></a>
<a href=""><img src="/img/social/delicious.png" class="social" rel="tooltip" title="Bookmark with Delicious"></a>
</nav>
</header>
</div>
</body>

</html>

Open in new window

0
 

Author Comment

by:RedBullLee
ID: 36506197
Thanks, SSupreme,

I've just had a play around with that and it works perfectly simply by adding;

header {overflow:hidden;}

Thanks for your help, much appreciated!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
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.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

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

16 Experts available now in Live!

Get 1:1 Help Now