• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 81
  • Last Modified:

HTML paragraphs not displayed next to each other horizontally

I am learning html/css and have written a simple bit of code to show the content of 3 divisions next to one another horizontally but it doesn't do what I intended. Rather it displays the divisions under one another.
Can you see what is wrong with my code  which is shown below ?
I also attach the screen shot of the code as viewed in Internet explorer.

html code viewed in Internet explorer
<!DOCTYPE html >

<title>Test 1</title>

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
body {
	line-height: 1;
ol, ul {
	list-style: none;
blockquote, q {
	quotes: none;
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
table {
	border-collapse: collapse;
	border-spacing: 0;

#div1 {float:left; width:300px;border-left:0px; background-color:#FF66FF;}

#div2 { width:300px; background-color:#9999FF;border-left:340}

#div3 {width:300px;background-color:#66FFCC};



<div id="div1">
	<p> Parabraph 1</p>

<div id="div2">
	<p>Paragraph 2</p>

<div id="div3">
	<p>Paragraph 3</p>



Open in new window


Roger Alcindor
Roger Alcindor
  • 2
  • 2
1 Solution
Roger AlcindorAuthor Commented:
Wrong picture uploaded, here is the correct one.htmlFileViewed in InternetExplorer
Dave BaldwinFixer of ProblemsCommented:
All 3 divs need to have 'float:left;' for them to 'float' next to each other.
Dave BaldwinFixer of ProblemsCommented:
Like this:
#div1 {float:left; width:300px;border-left:0px; background-color:#FF66FF;}

#div2 {float:left;width:300px; background-color:#9999FF;border-left:340}

#div3 {float:left;width:300px;background-color:#66FFCC};

Open in new window

Roger AlcindorAuthor Commented:
Thanks Dave.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

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