Welcome to our forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Forum Statistics

  • Forum Members:
  • Total Threads:
  • Total Posts: 5
There are 1 users currently browsing forums.
HTML/CSS Coding The basis of the World Wide Web, HTML, XHTML, and CSS make our forum possible, so it must be important right? Ask questions and receive help with these markups here.

Reply
  #1  
Old 11-25-2009
vento's Avatar
Sexy monkey
 
Join Date: May 2009
Location: Lithuania
Age: 17
Posts: 185
Rep Power: 2
vento is on a distinguished road
valign="middle"

Hello. So I want to make my website stick to the middle. Well, when the content is long, website gonna expand and so it will make no sense what valign parameter is set to, but let's say my website is pretty small. So I want to aling it exactly to the middle.

Question two. In the screenshot below you can see that my menu is small when there are just a few parameters. Is it possible to set minimum size of it? If I set the height, it gonna expand, I guess, but I want to set it as it might cause some problems like where to expand the element, width or height (some browsers may expand it to width). But this is not that important as this website project just started and so I gonna add more to it.

Here is teh screenshot so you can understand what I want better:
__________________

How to set up portable C++ IDE (Dev-C++)

Writing in C or C++ is like running a chain saw with all the safety guards removed," — Bob Gray.
Reply With Quote
  #2  
Old 11-25-2009
Goodbye Youngcoders
 
Join Date: Dec 2005
Posts: 1,864
Rep Power: 6
Umang is on a distinguished road
Re: valign="middle"

I think the min-width CSS property is what you are looking for.

Did you try vertical-align:middle? I've never tried it, but I doubt it works. I'm pretty sure you need to use a margin, maybe align it using JS. I'm not sure about how to center align vertically.
Reply With Quote
  #3  
Old 11-25-2009
vento's Avatar
Sexy monkey
 
Join Date: May 2009
Location: Lithuania
Age: 17
Posts: 185
Rep Power: 2
vento is on a distinguished road
Re: valign="middle"

it didn't help. BTW, I have tried puting valign="middle" on <tr> tags, but it simply doesn't work. It did work with the menu bar when used valign="top" on my menu bar, but it doesn't work if I put another table outside the main one and put valign there. Something wierd.

Ok, doesn't matter, I gonna be OK there is anotehr question as you suggested a CSS solution. Is it that bad if I use HTML attributes instead of CSS? I mean I use CSS, but I set bg color, font and stuff like that, while I use html attributes vor align/valign, width, height, background(used to make those rounded corners).
__________________

How to set up portable C++ IDE (Dev-C++)

Writing in C or C++ is like running a chain saw with all the safety guards removed," — Bob Gray.
Reply With Quote
  #4  
Old 11-26-2009
Goodbye Youngcoders
 
Join Date: Dec 2005
Posts: 1,864
Rep Power: 6
Umang is on a distinguished road
Re: valign="middle"

Always use CSS. It was only because of a lack of such a capability that HTML properties used for background color, fonts, etc. This is why tags like <center> and <font> tags have been deprecated. (HTML 4.01 / XHTML 1.0 Reference)

I also strongly suggest that you read CSS tutorials and make yourself very comfortable using CSS.

PS: Unless you're using the <table> for displaying data (and actually making a table), I would suggest that you learn to design websites without HTML Tables (using them only to display data like you would in a word processor).

Google found me an article on why it is better: CSS Table Less Format and HTML Table Base Format, Which One You Prefer

Here are a few articles Google found me (I've not read them, but they sound interesting. I would suggest that you look up for more articles if you are interested).

Create a Tableless Layout tutorialtastic.co.uk
A List Apart: Articles: Practical CSS Layout Tips, Tricks, & Techniques
A List Apart: Articles: Exploring Footers (This seems to be about vertical aligning. "A List Apart" always seems a little hard to read, especially if you're not super comfortable with CSS, but see if you like it any way)
A List Apart: Articles: From Table Hacks to CSS Layout: A Web Designer’s Journey
__________________
I'm off to sigcont.com
Reply With Quote
  #5  
Old 03-10-2010
Looking#'s Avatar
Toddler
 
Join Date: Mar 2010
Location: Maryland
Posts: 24
Rep Power: 0
Looking# is on a distinguished road
Re: valign="middle"

Here's exactly what you need to do:

1) Set the max-width of the content container to the MAXIMUM width you want
2) Set the margin of the content container to 0 auto (looks like this)

Code:
max-width : 800px;
margin : 0 auto;
Not only does this make sure that the container doesn't change size, but it also pins it in the center.

Good luck!
Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes 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
Trackbacks are On
Pingbacks are On
Refbacks are On