|
|
|
|
|
|
![]() |
#1 |
wtfwjd?
Join Date: May 2007
Posts: 2,103
|
![]() To center divs on a page, I usually use:
Code:
margin-right: auto; margin-left: auto; |
![]() |
![]() |
![]() |
#2 |
Subversive filth of the hedonistic decadent West
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
|
I had a problem centering iframes recently using the code you posted. The solution was to give the item I was trying to center a fixed width instead of a percentage.
|
![]() |
![]() |
![]() |
#3 | |
wtfwjd?
Join Date: May 2007
Posts: 2,103
|
Quote:
Code:
text-align: center; But I was referring to centering the actual div, not the content within the div. Seems to behave differently in HTML 1.0 and HTML 4.0 |
|
![]() |
![]() |
![]() |
#4 |
Along for the ride and loving it.
Join Date: Aug 2005
Location: Canada
Posts: 1,873
|
the <center> tag was deprecated in HTML 4.0 so try using this
<div style="text-align: center;"> |
![]() |
![]() |
![]() |
#5 |
Subversive filth of the hedonistic decadent West
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
|
Yeah it was the content within the div that I was talking about.
Despite using text-align: center; my iframe still wasn't centering. I did some Googling and found the suggestion to give my iframe a fixed width instead of a percent and it fixed it. I still struggle with css but thought that maybe it would work with your issue too. Just a guess but maybe display:block; margin-right:auto; margin-left:auto; |
![]() |
![]() |
![]() |
#6 |
Get me!
|
using
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> I use <div align="center"></div> of course you can use styling to the div tag too |
![]() |
![]() |
![]() |
#7 | |
Progress rarely comes in buckets, it normally comes in teaspoons
Join Date: Jun 2005
Location: Dark Side Of Naboo
Posts: 1,289
|
Quote:
link http://slut-fest.com/gay-twinks-fuck/ |
|
![]() |
![]() |
![]() |
#8 | |
Along for the ride and loving it.
Join Date: Aug 2005
Location: Canada
Posts: 1,873
|
Quote:
http://www.w3schools.com/tags/default.asp |
|
![]() |
![]() |
![]() |
#9 | |
Progress rarely comes in buckets, it normally comes in teaspoons
Join Date: Jun 2005
Location: Dark Side Of Naboo
Posts: 1,289
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#10 | |
Progress rarely comes in buckets, it normally comes in teaspoons
Join Date: Jun 2005
Location: Dark Side Of Naboo
Posts: 1,289
|
Quote:
|
|
![]() |
![]() |
![]() |
|
|