Solved

Wrapper around contenter problem

Posted on 2012-03-24
4
239 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

706 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