CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 29th, 2003, 04:43 AM
romalong's Avatar
romalong romalong is offline
life isn't we think of it
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2003
Location: Kiev
Posts: 1,840 romalong User rank is Sergeant (500 - 2000 Reputation Level)romalong User rank is Sergeant (500 - 2000 Reputation Level)romalong User rank is Sergeant (500 - 2000 Reputation Level)romalong User rank is Sergeant (500 - 2000 Reputation Level)romalong User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 10 h 35 m 11 sec
Reputation Power: 13
Question centering css object

please anybody tell me how to put css object exactly in the center of the creen without HTML tables? is it possible?

<style type="text/css">
<!--
.hdr{
border: 1px solid #000;
height: 120px;
width: 700px
}
-->
</style>

TNX!
__________________
/**
* lng
*
* @return unknown
*/


PHP | MySQL | Apache

Last edited by romalong : September 29th, 2003 at 05:07 AM.

Reply With Quote
  #2  
Old September 29th, 2003, 02:13 PM
sciguyryan sciguyryan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Rhondda Cynon Taff, Wales
Posts: 172 sciguyryan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 18 m 24 sec
Reputation Power: 5
tyr adding this, but i am no css guru:

PHP Code:
 aligncenter
__________________
Ryan Jones (RyanJ)

Reply With Quote
  #3  
Old September 29th, 2003, 02:55 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,299 jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 1 h 54 m 17 sec
Reputation Power: 760
Code:
body
  {
  text-align: center; /* IE fix, see below */
  }
.hdr
  {
  border: 1px solid #000;
  height: 120px;
  width: 700px;
  margin-left: auto;
  margin-right: auto;
  }
What you're looking for is margin auto. This will center a block element. However, IE doesn't understand this, so it may be necessary to text-align: center; the body. Note that this is not proper CSS b/c text-align: is not suppose to effect block elements, only text/inline elements.

There is another solution as well:
Code:
.hdr
  {
  position: relative;
  left: 50%;
  margin-left: -350px;
  }
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #4  
Old September 30th, 2003, 12:37 AM
romalong's Avatar
romalong romalong is offline
life isn't we think of it
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2003
Location: Kiev
Posts: 1,840 romalong User rank is Sergeant (500 - 2000 Reputation Level)romalong User rank is Sergeant (500 - 2000 Reputation Level)romalong User rank is Sergeant (500 - 2000 Reputation Level)romalong User rank is Sergeant (500 - 2000 Reputation Level)romalong User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 10 h 35 m 11 sec
Reputation Power: 13
oh, greate! thank u!
all i have to do is just compose some graphic,text and borders without common html tables in order increasing load speed.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > centering css object


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway