Solved

Wrapper around contenter problem

Posted on 2012-03-24
4
240 Views
Last Modified: 2012-03-25
Hi, I am new to html5 and css 3 and have a strange problem. In earlier projects I sometimes put a wrapper(after the body tag) around All my content to give the design a stroke or something. Now Im trying with HTML 5, but it wont work - only if I turn off the floating that is set to the 2 div elements I have under my header section - otherwise if floating is set to e.g. left the wrapper seem to only wrap around the header. How can I go around this, because I need the floating to have the 2 elements stand next to each other.
0
Comment
Question by:RapperOnStep
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37760952
OK. Check this out:
<html>
<head>
	<style>
		body { border:1px black dotted;}
		.floating {float:left;}
		header { border:2px blue solid;}
		#one {background:red;}
	</style>
</head>
<body>
	<header>
		This is your header
	</header>
	<div id="one" class="floating" >Div 1</div>
	<div id="two" class="floating" >Div 2</div>
</body>
</html>

Open in new window


As you can see, you can style the body element. No need for a wrapper.
0
 

Author Comment

by:RapperOnStep
ID: 37761049
Hi designatedinitializer.

Thx for your answer.

But if div 2 has a lot of tekst, it will flow under div 1. How can you avoid that? Otherwise it wont work as 2 column system...
0
 
LVL 7

Accepted Solution

by:
designatedinitializer earned 500 total points
ID: 37761344
well, that's a 2nd question...
just add width to the css rule, like this:

            .floating {float:left;width:50%;}

There you go.
0
 

Author Comment

by:RapperOnStep
ID: 37763374
off course. Silly me.

Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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…

910 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

21 Experts available now in Live!

Get 1:1 Help Now