473,403 Members | 2,284 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,403 software developers and data experts.

How to show 3 divs on the same line?

Hi.

I'm trying to put 3 divs on the same line, but it doesnt work.

My HTML part is:
Expand|Select|Wrap|Line Numbers
  1.     <div id="frame_twrap">
  2.           <div id="frame_tl"></div>
  3.           <div id="frame_t"></div>
  4.           <div id="frame_tr"></div>
  5.     </div>
  6.  
And the CSS is:

Expand|Select|Wrap|Line Numbers
  1. #frame_twrap {
  2.     top: 50px;
  3.     width: 944px;
  4.     height: 22px;
  5.     border: 1px solid black;
  6.     position: relative;
  7.     clear: both;
  8.     }
  9.  
  10. #frame_tl, #frame_tr, #frame_t {
  11.     background-repeat: no-repeat;
  12.     width: 22px;
  13.     height: 22px;
  14.     display: block;
  15.     z-index: 99;
  16.     margin: 0 auto;
  17.     }
  18.  
  19. #frame_tr {
  20. background-image: url(skin/new/frame_top_r.png);
  21. float: right;
  22. }
  23.  
  24. #frame_tl {
  25. background-image: url(skin/new/frame_top_l.png);
  26. float: left;
  27. }
  28.  
  29. #frame_t {
  30. background-image: url(skin/new/frame_top.png);
  31. background-repeat: repeat-x;
  32. width: 900px;
  33. }

And the result I'm getting is:
http://img.photobucket.com/albums/v4...divproblem.jpg

The 3 divs each has a background image for left, middle and right.
The border is just there to show the area they are confined to (have tried adjusting its size, no luck).

So can anyone please tell me why the right image won't place itself where it's supposed to be? :)
Dec 8 '10 #1
3 8515
Death Slaught
1,137 1GB
Give #frame_t a float: left;

Regards, Death

Edit: ^_^
Dec 8 '10 #2
JKing
1,206 Expert 1GB
frame_t needs a float:left;


A few other things...
Divs by default are block elements.
z-index only works on elements that have been positioned.

If your width is going to be fixed why not turn all three images into one? Then you just need a top and bottom div instead of each individual corner.

Edit: Seems I was a little slow! Doh! :)
Dec 8 '10 #3
Thanks, lol. Little thing fixed it all.

I'm gonna keep the width customizable, so i cant merge the images ;)

Thanks guys for the help and DIV info!
Dec 8 '10 #4

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

Similar topics

17
by: Stan Brown | last post by:
This seems simple, but I've been unable to figure out how to do it. I have a quotation in a paragraph of (let's assume) more than one line. I want to put the speaker's name at the end of the last...
7
by: opt_inf_env | last post by:
Hello, I would like to create a button which should be put in the end of a sentence (on the same line). I do like this: <html> This is my sentence. <form action=file.php> <input...
2
by: Steve Amey | last post by:
Hi all At the moment I am using the following code to check to see if the oTempDataSet is not nothing and that it has tables in it: If Not oTempDataSet Is Nothing Then If...
8
by: rfox | last post by:
My parade of IE problems continues. I have two divs in the banner area of my website, one containing a photograph, the other the title and logo for the program. (Please see...
1
by: swat | last post by:
hi im the beginner of the c++ ...how can i build the programm so that in the output box i can input a number n in the first line and in the second line i input n numbers on the same line with a...
3
by: cocco | last post by:
I'm trying to have several <hr>, all on the same line, even if this can seem a nonsense, with the shortest code. So, I do not want to use abolute positioning and virtual div. Is it possible to...
5
by: HMS Surprise | last post by:
I want to print a count down timer on the same line. I tried print '\r', timeLeft, which just appends to the same line. thanx,
7
by: rcw1983 | last post by:
I'm trying to get two divs on the same line....the problem I have is when the browser window gets smaller, the second div is being pushed below the first div....I want them to stay on the same...
0
by: Berlin Brown | last post by:
I have two DIVs on the same line, a left navigation frame and the right content. I want both of those items on the same line. Lets say the left nav content is 140pixels and the right content is...
5
by: chuckiechan | last post by:
This is what I would like it to do. Enter the search file to look in April_hours Enter your search item 50 150 #example of text in document April1, 50 100 150 75 200 April2, 100 150 200 75 250...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.