![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Raise Your Weapon
Industry Role:
Join Date: Jun 2003
Location: Outback Australia
Posts: 15,605
|
![]() I am resizing an image using CSS so that always fits within the browser window displaying the image.
The CSS I am using is Code:
div#sized { text-align: center; } div#sized img{ height: 90%; border: none; padding:15px; top: 10%; position: relative } Code:
<div id="sized"><a href="http://example.com"<img src="someimage.jpg" alt="image text" /></a></div> Does anyone have any idea on a better way to do this within the constraints of plain CSS and HTML ? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Registered User
Industry Role:
Join Date: Dec 2011
Posts: 10
|
You can use max-width to prevent the image from bleeding over the edge of the display area.
Code:
#sized img { max-width: 100%; } |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,248
|
Quote:
http://viewportindustries.com/blog/a...-in-wordpress/
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
|
photo / image auto resizing is simple...
.photo img { width: 100% } .photo { width: 40% } // print can be any size you want the default to be and can be applied to a div as a class. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Raise Your Weapon
Industry Role:
Join Date: Jun 2003
Location: Outback Australia
Posts: 15,605
|
Thanks for all the replies. I've got it sorted now.
|
![]() |
![]() ![]() ![]() ![]() ![]() |