6 replies [Last post]
Exodus
Exodus's picture
Offline
newbie
U.K.
Last seen: 13 years 1 week ago
U.K.
Joined: 2007-07-25
Posts: 3
Points: 0

Firstly let me say how thrilled i am to be using this forum, i have used it numerous times in the past and have finally decided to create an account. I'm trying to make a "fixed percent width" which might not make any sense but i don't know what else to call it! Take a look at http://www.lms-rpg.com/releases/v2-1/index/modern/login_success.html. If you resize your browser window you will realize the "main" section will expand or contract as the width of the div it is in is set to 80%. What i would like to do is make it so that the "main" section does not expand and contract when the browser window resizes and instead remains at the 80% width of the full size window. I am aware that this can be achieved through javascript but i would like to keep this strictly CSS and HTML. Any other comments are welcome but please be aware i don't take criticism well Tongue

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 6 years 22 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

how does that differ from a

how does that differ from a fixed width?

Exodus
Exodus's picture
Offline
newbie
U.K.
Last seen: 13 years 1 week ago
U.K.
Joined: 2007-07-25
Posts: 3
Points: 0

oh yeah, forgot to mention

oh yeah, forgot to mention that part, the reason i want to keep the 80% width is just to keep the layout fluid so it is accessible to different screen sizes and resolution. Another reason why i don't want the "main" part to move is so that i can line up the green background stripes

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 6 years 22 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

it's a fixed width design

80% of what? It sound like it's a fixed width design with the background image repeating.

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 3 years 3 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

You get a choice. Either

You get a choice.

Either 80% of the current browser size no matter what resolution and no matter if the window is resized or not.

Or you get a fixed width.

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

mihirc
mihirc's picture
Offline
Leader
Pune, Maharashtra, India
Last seen: 6 years 1 day ago
Pune, Maharashtra, India
Timezone: GMT+5.5
Joined: 2007-05-09
Posts: 728
Points: 204

Hi, why dont you giv %

Hi,

why dont you giv % widths to all your other divs? I really didnt get what you were trying to achieve.

mihir. Smile

Proprietor - Thoughtfulviewfinder Services
Web Development | Design | Merchandise | Photography
My personal blog: MihirChhatre.com

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 7 years 45 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

1. Don't do it. The browser

1. Don't do it. The browser belongs to the user. They have set it up to be the width they desire, which should you be attempting to make it larger so you can fill 80% of the screen. This is especially true as widescreens proliferate.
2. You are trying to resize the browser window - that can only be achieved with javascript.
3. If you are just trying to set the page width to 80% of the screen width and have the user horizontally scroll, you still need javascript to determine the screen width. Horizontal scrolling isn't normally desirable. Some people have 1024px wide screens, so your page needs to look good at 800px wide. Others have 1920px wide screens - your page would need to look good at 1500px wide, quite likely for someone who doesn't normally use their browser at anywhere near the full screen width.
4. Did I mention, don't do it. Wink