Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 972 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

Little help

Thread title: Little help
Closed Thread    
    Thread tools Search this thread Display Modes  
06-25-2007, 02:33 AM
#1
.Essence. is offline .Essence.
Status: Member
Join date: Aug 2006
Location:
Expertise:
Software:
 
Posts: 149
iTrader: 2 / 100%
 

.Essence. is on a distinguished road

  Old  Little help


<html>
<head>
<title> Tutorial Rewards - Coming Soon!</title>
<body bgcolor="101010">
</head>
<body>
<img src ="http://easyupload.us/uploads/images/63cba830c8f819142f773d9d297cc2dc.png"
align="center">
</body>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1757589-2";
urchinTracker();
</script>
</html>
Why isn't my image actually centered?

www.tutorialrewards.com

New to coding as you probably can tell

06-25-2007, 03:10 AM
#2
CreativeLogic is offline CreativeLogic
CreativeLogic's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 1,078
iTrader: 6 / 100%
 

CreativeLogic is on a distinguished road

Send a message via MSN to CreativeLogic

  Old

Because the align attribute on the img element does not work that way. It aligns the text around it the image. Your quickest fix is to change it to this:
<div align="center"><img src ="http://easyupload.us/uploads/images/63cba830c8f819142f773d9d297cc2dc.png"></div>

06-25-2007, 03:10 AM
#3
Andrew R is offline Andrew R
Status: Request a custom title
Join date: Dec 2005
Location: Arizona
Expertise:
Software:
 
Posts: 5,200
iTrader: 17 / 95%
 

Andrew R is on a distinguished road

  Old

Code:
<html>
<head>
<title> Tutorial Rewards - Coming Soon!</title>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
</head>
<body style="background:#101010;text-align:center;">
<img src ="http://easyupload.us/uploads/images/63cba830c8f819142f773d9d297cc2dc.png">
</body>
<script type="text/javascript">
_uacct = "UA-1757589-2";
urchinTracker();
</script>
</html>
Try that out, it should work.

06-25-2007, 03:20 AM
#4
.Essence. is offline .Essence.
Status: Member
Join date: Aug 2006
Location:
Expertise:
Software:
 
Posts: 149
iTrader: 2 / 100%
 

.Essence. is on a distinguished road

  Old

Originally Posted by CreativeLogic View Post
Because the align attribute on the img element does not work that way. It aligns the text around it the image. Your quickest fix is to change it to this:
<div align="center"><img src ="http://easyupload.us/uploads/images/63cba830c8f819142f773d9d297cc2dc.png"></div>
Originally Posted by Andrew R View Post
Code:
<html>
<head>
<title> Tutorial Rewards - Coming Soon!</title>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
</head>
<body style="background:#101010;text-align:center;">
<img src ="http://easyupload.us/uploads/images/63cba830c8f819142f773d9d297cc2dc.png">
</body>
<script type="text/javascript">
_uacct = "UA-1757589-2";
urchinTracker();
</script>
</html>
Try that out, it should work.
Thank you both Staff positions well deserved as well guys

06-25-2007, 04:24 AM
#5
TheCodeNinja is offline TheCodeNinja
Status: Junior Member
Join date: Apr 2007
Location:
Expertise:
Software:
 
Posts: 95
iTrader: 1 / 100%
 

TheCodeNinja is on a distinguished road

  Old

Note that "text-align: center" is primarily meant for text, but you can use it for images as well (at least for now). If you want it to work in all browsers and be more correct, you should also apply:

style="margin: 0 auto"

...to the image itself. But I'm a pedantic Code Ninja.

06-25-2007, 06:19 AM
#6
Haris is offline Haris
Status: Request a custom title
Join date: Dec 2005
Location:
Expertise:
Software:
 
Posts: 2,741
iTrader: 9 / 100%
 

Haris is on a distinguished road

  Old

Only IE renders text-align wrong. It aligns everything except text in IE because of which it is often used as a hack.

06-25-2007, 04:07 PM
#7
Andrew R is offline Andrew R
Status: Request a custom title
Join date: Dec 2005
Location: Arizona
Expertise:
Software:
 
Posts: 5,200
iTrader: 17 / 95%
 

Andrew R is on a distinguished road

  Old

TheCodeNinja: I usually use it for text, but most of the times when I use it with text, there is an image above it. I was thinking of using margin: 0 auto;, but I couldn't recall if the img tag uses the image dimensions and has a predefined height and width or not.

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed