[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

Wrapper around contenter problem

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
RapperOnStep
Asked:
RapperOnStep
  • 2
  • 2
1 Solution
 
designatedinitializerCommented:
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
 
RapperOnStepAuthor Commented:
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
 
designatedinitializerCommented:
well, that's a 2nd question...
just add width to the css rule, like this:

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

There you go.
0
 
RapperOnStepAuthor Commented:
off course. Silly me.

Thank you.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now