Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

CSS - Placing an Image over a Header

Posted on 2011-09-08
2
191 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Put shading on half of picture 8 51
css icomoons will not display on page 14 33
push logos in footer up higher 5 25
100% tall div not scrollable on iPhone 3 20
When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

856 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