Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-02-2009, 09:35 PM   PM User | #1
tomrshl
New Coder

 
Join Date: Aug 2009
Posts: 31
Thanks: 3
Thanked 0 Times in 0 Posts
tomrshl is an unknown quantity at this point
Horizontal scrolling div stretch to content

Hi, I have an <ul> of images styled as display:inline

Can I have the div they are in overflow:auto horizontally without setting a width?

In other words stretch the div to fit a horizontal line of images instead of them breaking onto a new line?
tomrshl is offline   Reply With Quote
Old 11-03-2009, 07:25 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Hi, I have an <ul> of images styled as display:inline

Can I have the div they are in overflow:auto horizontally without setting a width?
Please post your current code or a link to your page and explain the issue/requirement, rather than giving a puzzle in your thread.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 11-03-2009, 07:32 AM   PM User | #3
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello tomrshl,
I've never been able to do it. The div with the scroll bar needs a width and the img container takes it's width from that, inless you specify otherwise.
I have an example here: http://nopeople.com/CSS/scrollers/index.html
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 11-03-2009, 05:41 PM   PM User | #4
tomrshl
New Coder

 
Join Date: Aug 2009
Posts: 31
Thanks: 3
Thanked 0 Times in 0 Posts
tomrshl is an unknown quantity at this point
Code:
* {
	margin: 0;
	padding: 0;
}

body {
	font-family: "Helvetica", "Arial", sans-serif;
	font-size: 12px;
}

#container {
	width: 100%;
	height: 100%;
}

#main {
	overflow: auto;
	white-space:nowrap;
	text-align: left;
	position: absolute; top: 100px; left: 0; right: 0; bottom: 0;
}

#header {
	height: 100px;
	text-align: left;
	position: fixed; top: 0px; left: 0;
	width: 100%;
}


ul, li {
	display: inline;
}
This is what I worked out, seems to work as I wanted.

Thanks anyway
tomrshl is offline   Reply With Quote
Reply

Bookmarks

Tags
horizontal, images, inline, scroll

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:10 AM.


Advertisement
Log in to turn off these ads.