View Full Version : How to center default image and info?
Twizted
08-28-2006, 03:34 PM
Another MYSPACE question:
I've googled it, but can't find it anymore...
I just need to center the default image inside the table.
I've already gotten rid of all the other junk in that block (name, info, last login).
I know I've seen this code before, but I just can't seem to find it right now...
Thanks!
IvanJ
08-28-2006, 03:50 PM
Not being sure what code you're working with, I can take a stab at it. I suspect you're looking to center an image within a <td> tag in a table element. If so, and if you're not interested in working with CSS, then you can go to the corresponding column and make it <td align="center">. This makes whatever content you place within this column center-aligned. Info (whatever this refers to) will be center-aligned if it's placed within this <td> tag along with the image.
Good luck.
Arbitrator
08-28-2006, 04:26 PM
I don't think you can alter the HTML on MySpace and using the deprecated align attribute is bad practice anyway. You can center a lone image inside a table cell by using CSS text-align: center on the table cell, assuming that the image is set to the default display: inline (as text). You can also use display: block and margin: 0 auto on the image to center it within the table cell.
zro@rtv
08-28-2006, 04:42 PM
...ha! thats funny... "dont use deprecated markup on myspace"....? cause myspace is such clean awesome markup to begin with... wouldnt want to muck it up now!</sarcasm>. (sry for useless post, but I found that humorous. and i undersand that itd still be bad practice....)
Arbitrator
08-28-2006, 04:52 PM
...ha! thats funny... "dont use deprecated markup on myspace"....? cause myspace is such clean awesome markup to begin with... wouldnt want to muck it up now!</sarcasm>. (sry for useless post, but I found that humorous. and i undersand that itd still be bad practice....)I didn't think about it that way, but you're right. :p
Can't say that it'd help to make MySpace worse than it already is though.
Twizted
08-28-2006, 08:52 PM
Unless you're familiar with myspace, and how the "myspace codes" (as they like to call them) work, then it'll be hard to explain what I mean.
This is the "code" I used to remove the General Info stuff (name, location, last login, etc):
<style type="text/css">
table td.text {visibility:hidden;}
td.text td, td.text span, td.text a {visibility:visible;}
</style>
That worked fine, but now the only thing that remains is the picture, and I want to center it.
Maybe this'll help you understand:
http://www.myspace.com/reboundstest
The NO PHOTO image is what I want centered.
Not centered to the page, but centered in the TD
again, I'm assuming that only people familiar with myspace would be able to answer this question.
Arbitrator
08-28-2006, 11:35 PM
Unless you're familiar with myspace, and how the "myspace codes" (as they like to call them) work, then it'll be hard to explain what I mean.
This is the "code" I used to remove the General Info stuff (name, location, last login, etc):
<style type="text/css">
table td.text {visibility:hidden;}
td.text td, td.text span, td.text a {visibility:visible;}
</style>
That worked fine, but now the only thing that remains is the picture, and I want to center it.
Maybe this'll help you understand:
http://www.myspace.com/reboundstest
The NO PHOTO image is what I want centered.
Not centered to the page, but centered in the TD
again, I'm assuming that only people familiar with myspace would be able to answer this question.That code is hardly unique to MySpace. MySpace runs on (invalid and poorly constructed) X/HTML (I can't tell which due to the poor construction) interlaced with CSS which is why you're asking for assistance in an HTML and CSS forum. That means that people that aren't familiar with MySpace (like myself) should be able to assist.
Being that the code in the area containing the image that you wish to center is particularly screwed up, I can't center the image through conventional methods like the ones I described in my previous post. The CSS #ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage {position: relative; left: 115px;} should tentatively "center" the image in that "table cell". I say "table cell" with quotation marks because it seems that there's not really a table cell there due to the poorly constructed code; the browser is simply guessing what the code means and building the page based on those guesses (and it does it pretty well, considering). Note that this is only tested in Firefox; I have no easy method of doing so in other browsers.
And no, I'm not blaming you for MySpace's messed up code. Even this forum, and almost every other site I visit, uses invalid code with a table-based layout yet I use them anyway.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.