473,385 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How align three elements in single line with css?

103 100+
I would like the page with three columns: left-adv, container, right-adv. But right-adv goes below container. DO not know how to keep it on the same line to the right.

I have tried clear and float. Could you please tell how to achieve this.

Expand|Select|Wrap|Line Numbers
  1. #page-container{
  2.     width: 60%;
  3.     background: red;
  4. }
  5. #left-adv{
  6.     width: 10%;
  7.     background: blue;
  8.     float: left;
  9. }
  10. #right-adv{
  11.     width: 10%;
  12.     background: blue;
  13.     float: right;
  14. }
Expand|Select|Wrap|Line Numbers
  1. <div id="left-adv"> Left advertisement </div><!--left-adv -->        
  2.  
  3. <div id="page-container"> page container </div> <!--page-container -->  
  4.  
  5. <div id="right-adv">  Right advertisement </div><!--right-adv -->
Aug 17 '14 #1
1 1500
gintare
103 100+
Found the answer. All three elements must float:



Expand|Select|Wrap|Line Numbers
  1.     #page-container{
  2.         width: 60%;
  3.         background: red;
  4.         float: left;
  5.     }
  6.     #left-adv{
  7.         width: 10%;
  8.         background: blue;
  9.         float: left;
  10.     }
  11.     #right-adv{
  12.         width: 10%;
  13.         background: blue;
  14.         float: left;
  15.     }
Aug 17 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: DLP22192 | last post by:
I have the following single-line if statement that is evaluating true even though it shouldn't. I have never seen this before and I am concerned that this can happen in other areas of my code. ...
7
by: bclegg | last post by:
Hi, I have a Monitoring application that needs to output single line summaries to a local dot matrix printer loaded with line flow. ie. It will have exclusive use of the printer which is connected...
3
by: saad82 | last post by:
I want to be able to replace a single line in a large text file (several hundred MB). Using the cookbook's method (below) works but I think the replace fxn chokes on such a large chunk of text. For...
26
by: unexpected | last post by:
If have a list from 1 to 100, what's the easiest, most elegant way to print them out, so that there are only n elements per line. So if n=5, the printed list would look like: 1 2 3 4 5 6 7 8...
2
by: sk.rasheedfarhan | last post by:
Hi , I have to extract a xml file line by line. Here is my xml Step1: <category name= "name" guid="{guid}"state="enabled"> Step2: <rules> Step3: <rule name="rule name" guid="{guid}"...
6
by: Michael7 | last post by:
Hi everyone, Me again! I'm having a problem centering a single line in a div. I have a news section that is a block of it's own, and centered. The text in the news section is left aligned of...
10
by: Itaichuk | last post by:
Hi I read in several CSS tutorials that block-level elements, such as <div& <pare rendered with an implicit line break before and after. I set to test this out using the following HTML: I...
1
by: Nethra | last post by:
Hi... I am trying a program which convert the multiline comment type in a program to single line comment type ie. /*have a nice day */ to //have a //nice day
1
by: vikastcser | last post by:
Hi All , I have a table where four rows are there and each row has two tds.one td is for label and two image icons and other td is used for keeping numeric values. I am able to accomodate digits...
5
by: tess1243 | last post by:
I want to place three different labels in single line. Example: <div id="lbl1" class="Label"> <div class="Label-pnl10010"> <span class="Label-pnl10010-lbl10010">Are you sure you want...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.