473,473 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CSS Min-Width Headache

24 New Member
Hi,

I've been having a problem with CSS that's driving me crazy. I'm basically trying to set the minimum width of a div to 750px and the width to 100%, so that viewed at a resolution under 800x600, the view will still hold shape and viewed above 800x600, the view will center (I'm using text-align: center to center the div once it's 100% wide).

Makes sense? Here's the code:

CSS:

Expand|Select|Wrap|Line Numbers
  1. .centerDiv
  2. {
  3.     text-align:center;
  4.     min-width:750px;
  5.     width:100%;
  6. }
HTML:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.  ...
  3.      <div class="centerDiv">Some text</div>
  4.  ...
  5. </html>
The trouble is, when using Visual Studio 2005, the "min-width" bit in the CSS shows a red underline saying "'min-width' is not a known CSS property name"... The weird thing is, I tried it anyway and it works great in IE7, but doesn't work in Firefox... (it's usually the other way round eh?). I'm almost 100% sure that min-width IS a valid CSS property name, so can someone please show me what I'm doing wrong?

Thank you in advance,

Oli

PS if I use inline style:
Expand|Select|Wrap|Line Numbers
  1. <div style="min-width:750px;">Some Text</div>
there's no error in Visual Studio, but I still get the same results.
Jul 13 '07 #1
4 4663
Queez
24 New Member
Hey, my bad - I just tried it again and it's working in Firefox, not IE... so I guess there'll be loads of explanations out there.

Still, this sucks, there's a min-height property, so why not put a bloody min-width in there too? Bastards.
Jul 13 '07 #2
nitinpatel1117
111 New Member
Min-height and mid-width do exist, but they are just not supported by IE6, but are supported by other broswers and IE7.
Jul 13 '07 #3
Queez
24 New Member
So min-width IS supported by IE7? Ok, thanks I'll give it a go.
Jul 13 '07 #4
drhowarddrfine
7,435 Recognized Expert Expert
Yes, it works on IE7 but poorly. It will probably be OK for what you want.
Jul 13 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Claudio Grondi | last post by:
Trying to understand the outcome of the recent thread (called later reference thread): "Speed quirk: redundant line gives six-fold speedup" I have put following piece of Python code together:...
3
by: Ker | last post by:
I have a query that works great. It gives me the min for multiple fields. Within this query, I also need to get the max of some fields too. I currently have output of Date Name ...
5
by: kevinjouco | last post by:
Hello Have searched the group for a solution to the following problem without success: Table 1 has Ref No (No Duplicates) & Min Max Value Fields ie Ref No 1 Min 1 Max 10 Ref No 2 Min 11 Max...
5
Min
by: Gregc. | last post by:
Hi I am trying to find the min of a list of numbers. For example, if a user enters 10 numbers 1,2,3,4,5,6,7,8,9,9 then the min would be 1. I've looked as past posts on the topic, and there was...
4
by: MRAB | last post by:
Hi, Some time after reading about Python 2.5 and how the built-in functions 'min' and 'max' will be getting a new 'key' argument, I wondered how they would treat those cases where the keys were...
4
by: jaip26 | last post by:
All, I came across a strange situation in my query. Basically here is the result of my query. col1 col2 col3 col4 col5 col6 col7...
11
by: lovecreatesbea... | last post by:
#define MIN(x, y) ((x)<(y) ? (x):(y)) Can a version without conditional operator of MIN macro be written?
4
by: BoscoPippa | last post by:
Hi all, I'm a rank beginner to C++ and programming in general. I'm in week 6 of my first course, and we have an assignment I'm having a little trouble with. If it matters, we're using standard...
19
by: Eugeny Myunster | last post by:
I know, only simple one: #include <stdio.h> int main() { int min=0,max=0,i,arr; for(i=0;i<12;i++) arr=rand()%31-10; for(i=0;i<12;i++)
16
by: Peng Yu | last post by:
Hi, I'm wondering if there is a min function (in boost, maybe?) that accepts any number of arguments? std::min only accepts two arguments. If I want to get the minimum number out of many, I have...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.