Solved

Wrapper around contenter problem

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How would I do a website like this? 5 57
Input box gone wrong 8 24
Decoding Special HTML Characters using Javascript? 2 29
CSS: Making responsive table look nicer 7 27
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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 …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

777 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