...

View Full Version : Div Overlapping (Rounded Border)



Shoot2Kill
12-26-2010, 12:25 PM
Hi, i think visiting http://scalamoosh.com will show clearly what my problem is.

the div below the 'Article Title' which just displays 'Text' i would like to be raised up slightly, but be behind the title div, so the round borders do not have the small gap.

hope this is clear enough.

thanks!

Excavator
12-26-2010, 12:59 PM
Hello Shoot2Kill,
Merry Christmas :)

Putting the rounded corners on the p tag may not be the best way to do this. Your posts would all be limited to one paragraph that way.

Instead, put rounded corners on the article element and put "Article Title" and "one line...article" in a heading tag with bottom rounded corners.
That way the article can expand to contain multiple paragraphs and pictures and whatever else you put in there.

Shoot2Kill
12-26-2010, 01:15 PM
Thanks, that does sound like a much better way, however i am having trouble implementing it.

when you say use the title and subtitle in a heading, i guess you mean <header> ?

when i try that, the header (with a border) is displayed below both titles and with no content.

http://scalamoosh.com to see what i mean.

edit--
also, firefox is showing an extra border above the title, that chrome doesnt show.

edit #2--
Excuse my rudeness, Merry Christmas Excavator! :D

Shoot2Kill
12-26-2010, 05:21 PM
I have it working a little better now, but still would like the original look if possible..

http://scalamoosh.com

Excavator
12-26-2010, 08:06 PM
You're getting there. I think you are mis-naming elelments though. It seems to me a section would contain multiple articles, not the other way around.

Try it like this -
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
html, body {
margin: 0;
font: 100% "Trebuchet MS", Arial, Helvetica, sans-serif;
color: #000;
background: #fc6;
}
/* HTML5 tags */
header, section, footer,
aside, nav, article, figure {display: block;}
#container {
width: 900px;
margin: 0 auto;
background: #999;
overflow: auto;
}
section {
width: 675px;
float: left;
margin: 25px 0 0 5px;
padding: 2px 0 0;
}
section header {
text-align: center;
background: #220b28;
border: 2px solid #bbb;
border-radius: 10px;
-moz-border-radius: 10px;
}
section header h1 {
margin: 0px 2px 0px 2px;
font-size: 1.4em;
color: #e15f0b;
}
section header h2{
margin: 0 2px 0 2px;
padding-bottom: 5px;
font-size: 1.2em;
color: #ddd;
}
section article {
margin: -10px 0 20px;
padding: 20px;
border: 2px solid #bbb;
-moz-border-radius: 0 0 10px 10px;
border-radius: 0 0 10px 10px;
border-top: none;
}
aside {
height: 400px;
width: 180px;
float: right;
background: #ccc;
}
</style>
</head>
<body>
<div id="container">
<section>
<header>
<h1>The Streets</h1>
<h2>Computers & Blues</h2>
</header>
<article>
<p>Posted Today, at 16:00, By <a href="#">Scalamoosh</a></p>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no
sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo
duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
</p>
</article>
</section>
<aside>
</aside>
<!--end container--></div>
</body>
</html>


Background colors are running over borders since negative margins are needed to move the sides up to tie in together, so I left them out for now. You will probably need some z-index to fix that...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum