Reply
2 problems
Old 03-06-2008, 06:27 AM 2 problems
Experienced Talker

Posts: 31
I would like to have a div that looks like on the image attached to this thread, but I would like it to be maximum flexible, so that width and height are in %, not in px.
Any ideas how to do that?

Also, I would like to have a layout that have 3 columns, first one should be in percents and second and third in px, but second and third are NOT generated on every page, and I would like the first one to take their space also if they are not generated, so this is an example:
1)

[ div 1 ] [ div 2 ] [ div 3 ]

2)

[ div 1 ] [ div 2 ]




3)

[ div 1 ]


I hope you understand and sorry for bad English!
Attached Images
File Type: jpg div.jpg (48.2 KB, 7 views)
goranbaxy is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 03-06-2008, 08:38 AM Re: 2 problems
chrishirst's Avatar
Super Moderator

Posts: 13,468
Location: Blackpool. UK
So something like;
HTML Code:
<div style="position:relative;width:25%;border:1px solid #666666;padding:5px;">
<div style="position:absolute;text-align:center;width:15%;left:5%;top:-10px;background-color:#ffffff;">Text</div>
 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
 </div>
For Q1

and Q2
You would create a single column as a 100% wide container. Then cols 2 & 3 would be created inside the parent and floated to the right at 100% height.
This way the parent container content would flow around the other 2 if they were there and occupy full width if they are not.

The only proviso, would be to ensure that the right most columns are in the parent before the text content.

If I get time I'll do a DHTML demo of it.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-06-2008, 02:24 PM Re: 2 problems
LadynRed's Avatar
Super Moderator

Posts: 6,534
Location: Tennessee
Lots of 2 and 3 column layout examples can be found here:
http://css-discuss.incutio.com/?page=CssLayouts
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 03-08-2008, 08:44 AM Re: 2 problems
Experienced Talker

Posts: 31
Thanks people, I'll try this, sounds like a good solution!
__________________
Igre | Igrice | Forum | Vicevi --> my fun portal!
Slike | Igraona --> my forum

Last edited by goranbaxy : 03-08-2008 at 10:21 AM.
goranbaxy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to 2 problems
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12947 seconds with 13 queries