Centering my blog

Now I'm not making it a common habit to ask for help on myspaace or xanga or any other blogs. There are plently of other forums for that. But I don't have accounts for them so this is the only question:

See my blog in my signature? How do i center the body to be 650px?

.maincenter { width: 650px; }

doesn't work...Please help :)

#408817

Why don't you apply the width to the body?

Also, you can center elements by using {margin: 0px auto 0px auto;} on the element.

-NC

#408822

No, then my header at the top would be centered as well, which is what i don't want.

Edit: I used the second half of your comment and that helped a lot. You are my hero NC, hehe. Always there when I need ya!

blog-header { margin: 0px auto 0px auto }

blog-body { margin: 0px auto 0px auto }

#408873

One last thing. I've been removing a whole bunch of tables, but I can't seem to remove a 2nd table row (tr) and not the first. I can remove the first tr by adding in

.blogbody tbody tr { display: none }

but that removes my blog contents (1st table row). I want to remove the table row below that one. I hope I'm making sense. Please help! I'm learning so much by doing this! :D

#409112

Well, there are no tbody tags in your code....I'm not even sure how that works at all.

You could probably hide all table rows and then show only the first one.

table.blogbody tr {display:none;}

I don't recall if Internet Explorer supports the first-child pseudo-selector (used to identify an element when it is the first child of another element...not to identify the first child of the given elements).

table.blogbody tr:first-child {display: block;}

This will show only table rows that are the first child of other elements (and since we specified that the tr had to be a descendant of the table with class blogbody, there's no chance of other tr elements falling prey to this rule. Internet Explorer may or may not support this. You can also try using the partial/exact attribute selector to identify that first tr.

http://24ways.org/advent/the-attribute-sel...nd-no-ad-profit

http://www.w3.org/TR/2001/CR-css3-selectors-20011113/

It's tough, but you may be able to do it!

Good luck,

-NC

#409181

no blog in your signature :(

just have margin: 0 auto; for the div you want to center

for body have text-align: center; [this is because IE sucks]

#409232

Hello again...

table.blogbody tr {display: none; } removes both the blog contents and the 2nd table row below it.

If I could make a visual diagram of it, it would sorta look like this:

..

....

....

..

I'll try what you said, NC!

Edit: Yaay Yaay! I works works! table.blogbody tr:first-child {display: block;} in addition to the above works great on Firefox and Safari. It complete removes my blog in IE, but who cares! I don't use IE and neither should my visitors. Can I do a javascript element for IE users that would display a popup box that says "Sorry, my site doesn't work in Internet Explorer. Please get Firefox."?

#409254

What happens if you try

* html table.blogbody tr {display: block;}

? It shouldn't have any effect in Firefox or Safari, but may work in Internet Explorer...

-NC

P.S: I'm not sure if you can stick in a Javascript element simply because I don't know how much control you have over Xanga's outputted code...anyway I could find out? If there's a section for you to stick stuff in the

part of the code, then sure...

-NC

#409265

yes, javascript elements work fine with xanga as far as i've seen

by the way, did you mean to add the code in addition to :first-child element?

#409267

Sure, just stick it anywhere. Only IE would be able to understand it.

Also, you could look at conditional comments, like this:

<!--[if IE]>
<style>
table.blogbody tr {display:block;}
</style>
<![endif]-->

Only IE will understand that...every other browser will simply treat it as a comment.

http://www.javascriptkit.com/howto/cc2.shtml

If you're still stuck on a JS script, I'm sure you could try that out as well ;).

-NC

#409293

wait, its a xanga??

in the looks & feels cant you just click "center" -_-

#409392

@pwnzrzpat, we already answered that above, but it's a custom header so that doesn't work completely.

#409550