corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Any CSS geeks?


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Any CSS geeks?
liamC
Member

Registered: 28th Feb 04
User status: Offline
26th Jun 11 at 11:43   View User's Profile U2U Member Reply With Quote

Have an image sitting inside a div, but IE8 & 9 keep putting a vertical scrollbar on the side, for no reason whatsoever.

Code is as follows:

---

HTML

<div id="imagecontainer">
<img src="image.png">
</div>

CSS

#imagecontainer{width:400px; overflow: auto;}

---

Any ideas what I can do to get rid of this daft scrollbar? It is fine in every other browser and version other than IE 8 & 9.
Neil
Member

Registered: 2nd Nov 03
Location: Newcastle Drives: E46 MSport Coupe
User status: Offline
26th Jun 11 at 11:49   View User's Profile U2U Member Reply With Quote

overflow:auto will put a scrollbar on the div if the image is larger than 400px wide...

http://www.w3schools.com/css/pr_pos_overflow.asp

[Edited on 26-06-2011 by NeilM]
Dom
Member

Registered: 13th Sep 03
User status: Offline
26th Jun 11 at 11:52   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by NeilM
overflow:auto will put a scrollbar on the div if the image is larger than 400px wide...

http://www.w3schools.com/css/pr_pos_overflow.asp



As Neil said, use Overflow: hidden; if you want to disable scrollbars on a div.

Edit - Also make sure you have !DocType sorted, that can cause overflow issues in IE8. Likewise div position.

[Edited on 26-06-2011 by Dom]
liamC
Member

Registered: 28th Feb 04
User status: Offline
26th Jun 11 at 12:01   View User's Profile U2U Member Reply With Quote

Sorry, made a mistake on the code - There is no specific height or width set, just overflow: auto, and to float:right
Neil
Member

Registered: 2nd Nov 03
Location: Newcastle Drives: E46 MSport Coupe
User status: Offline
26th Jun 11 at 12:35   View User's Profile U2U Member Reply With Quote

visible The overflow is not clipped. It renders outside the element's box. This is default

hidden The overflow is clipped, and the rest of the content will be invisible

scroll The overflow is clipped, but a scroll-bar is added to see the rest of the content

auto If overflow is clipped, a scroll-bar should be added to see the rest of the content

inherit Specifies that the value of the overflow property should be inherited from the parent element


Use visible or hidden to not have scroll bars on the div.

If the size of the image changes (uses different images), just use float:right... shouldn't need any other styling. Was there a reason for wanting to use overflow?

[Edited on 26-06-2011 by NeilM]
liamC
Member

Registered: 28th Feb 04
User status: Offline
26th Jun 11 at 13:33   View User's Profile U2U Member Reply With Quote

Thanks, this overflow was the issue. Have changed it to hidden.

Just in case this is of help to people, and I am probably years behind the normal world, I have came across Adobe Browser Labs to test across all browsers - well worth it for web people

https://browserlab.adobe.com

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
CSS webdesign help Houckham Geek Day 3 910
20th Apr 06 at 11:01
by Houckham
 
any web designers here??? KITcorsa Geek Day 7 1614
12th Jul 06 at 19:16
by Dom
 
FAO: Webmasters: CSS Bart Geek Day 14 1140
24th Oct 06 at 14:57
by Ian
 
Input on a website please, web designers especially :D drunkenfool Geek Day 56 3051
25th Nov 06 at 19:08
by aPk
 
CSS Help Jodi_the_g Geek Day 5 718
11th Nov 08 at 16:42
by Jodi_the_g
 

Corsa Sport » Message Board » Off Day » Geek Day » Any CSS geeks? 28 database queries in 0.0093319 seconds