Center Only Comments MySpace
Centering Comments while Keeping default friend space to the right.
I have 4 solutions. Each one has different limitations, and in almost all cases the person applying the code must adjust the pixel (px) values based on their own page (and again when changing the page).
The solution which works the best for you depends on how your page is laid out, and what side effects you are willing to accept.
To Determine which solution to use, refer to below chart.
Consistent, as used in the below, means Consistent across the different browsers, resolutions, dpi settings you expect your page to be viewed.
Solution 1
This one is dependent on Distance B.
Negatives:
Can not widen the comment space wider than 475px without messing up page alignment
Positives:
Less dependent on measurement (for relative or absolute placement) over areas which vary a lot in px size between browsers, resolutions, dpi settings etc ...
IF YOU DO NOT WANT TO WIDEN THE COMMENT AREA THIS IS USUALLY THE BEST SOLUTION.
This solution uses relative placement to shift the comment table to the left AND down (if needed). The distance Down is the distance shown as B in the picture.
Insure you shift it down, enough to accommodate the different browsers and resolutions you expect your page to be viewed.
As you do, you will notice the following:
- In IE it shifts the whole profile to the left.
- In FF it shifts the left column to the left, widening the gap between the right and left columns.
Solution 2 (Modified to use Distance B instead of Distance A. Thanks to Ralf for making me aware that absolute positioning could be used without setting a top value or changing the vertical position of the element).
Use absolute placement to move the comments horizontally only; maintaining their current vertical position.
IF distance B is positive, create a top margin in the comment space, equal to or greater than distance B.
Negatives:
Requires that the bottom links be removed. WARNING: I have recently learned that some profiles are being deleted due to hiding the bottom links. For this solution I recommend AGAINST hiding the bottom links. I will have new code for this soon.
If you have used background coloring for your main table, you comment space will now stick out below that table, giving an "off" appearance. However, you can fix this by using the body background color which is the same.
Positives:
This strategy takes far less code than 3 or 4.
This strategy relies on Distance B, which is usually the smallest and most consistent of all the distance choices.
If your friend space (or other content in your right column) grows, it will automatically push the comment space down to accommodate.
Logically removes the comments from right column, so they can be made wider without distorting the page alignment.
Preparation:
Measure Distance B.
If it is negative, and you expect it to remain negative, then no use of this distance is required
If it is positive, you will need to use this as a top margin to the comment space.
I have this values shown in Bold, in the below code.
Set it to 0 if your value for B is Zero or negative.
[Solution 3 Pending]
Solution 4 This strategy relies on distance D.
First move the entire block (Friends, comments, calendar) to the bottom center. I do this by closing tables (and re-opening them to maintain balance). This causes the section to fall into place, just underneath the bottom of the left column, and above the bottom links.
Next I use absolute placement to move the friends (and calendar if you have one) back to their original location. This causes the comment section to move up and place itself directly under then left column and just above the bottom links.
To determine the absolute placement for the friendspace measure distance D (as shown in the picture). My values ranged from 733px to 800px (using 2 computers, both IE and FF on each computer, with different resolution and dpi settings).
Because I have enough space in distance C (see picture) for my friendspace to fit, while allowing enough space to accommodate variance among the different computers/settings, this solution works pretty well for me.
I use 808px (to allow an 8px top margin).
Place this code at the bottom of the "To Meet" section. Modify the value shown in bold to suit your profile.
Same solution as above, but with a calendar
If you used the solution above (solution 4), and you had a calendar showing, it is probably now sitting just above your comments (bottom center).
You can use the same technique to move the calendar that was used to move the friends.
The calendar does NOT have its own class, but it is the only table, at this level:
myTclassFC table
Which does not have its own class.
Therefore I can address it this way, and then reverse the effect at levels
myTclassFC table.friendsComments
myTclassFC table.friendSpace
Now it is easier to see why I used the class, and explicitly specified it when I moved the friendSpace.
Look at the following page:Page showing Comments Bottom Center and Calendar Top Right
To make this layout work, I choose to keep, on the right side of the profile, only those items which sized consistently in the multiple browsers, resolutions, and dpi settings I was using. Anything that has the size defined, based only on px values, will do this.
I moved my Blurbs (About Me) to the Left Column. I replaced my Blogs with a picture.
I then turned my Extended network invisible {visibility:hidden}, to make room for my calendar.
I then pasted in this style block (it can go almost anywhere, I put it at the bottom of my meet section, just below the style block for centering comments:
[Note: All of the above assume the left column is longer than the distance from the top of the page to the bottom of the blurbs (the right column minus friends and comments). If this is NOT the case, then you may want to consider a layout more like this:
Friend And Comments Side by Side
or This
Center Friends and Comments]
I have 4 solutions. Each one has different limitations, and in almost all cases the person applying the code must adjust the pixel (px) values based on their own page (and again when changing the page).
The solution which works the best for you depends on how your page is laid out, and what side effects you are willing to accept.
To Determine which solution to use, refer to below chart.
Consistent, as used in the below, means Consistent across the different browsers, resolutions, dpi settings you expect your page to be viewed.
![]() | A: Distance from Top of Page to Bottom of Left Column. I see no need for a solution which uses this distance. It is so rarely consistent and NEVER smaller or more consistent than B. I replaced all use of distance A with a solution which uses Distance B. B: Distance From Top of Comment Space to Bottom of Left Column. I use this distance in solutions 1 AND 2. Solution 1 does NOT allow me to widen the comment table to more than 475px. IF you do NOT WANT TO WIDEN your comment table, and distance B is small (zero or negative), AND you want to keep your bottom links OR you are using a background color for your main table; Then solution 1 should work well for you. IF you do want to widen your comment space, AND do not mind removing your bottom links AND have made the main table background transparent; then Solution 2 is a better choice. C: Distance from Bottom of Left Column to Bottom of Blurbs. Solution 3 Uses this distance. IF you want to widen your comment table AND (Keep Your bottom links OR have a background color for your main table) AND distance C is consistent this may be your best solution. D: Distance from Top of Page to Bottom of Blurbs. I use this distance in solution 4. IF you can make Distance D consistent, then this is a good choice. This does allow you to keep your bottom links, and background coloring to the main table. |
Solution 1
This one is dependent on Distance B.
Negatives:
Can not widen the comment space wider than 475px without messing up page alignment
Positives:
Less dependent on measurement (for relative or absolute placement) over areas which vary a lot in px size between browsers, resolutions, dpi settings etc ...
IF YOU DO NOT WANT TO WIDEN THE COMMENT AREA THIS IS USUALLY THE BEST SOLUTION.
This solution uses relative placement to shift the comment table to the left AND down (if needed). The distance Down is the distance shown as B in the picture.
Insure you shift it down, enough to accommodate the different browsers and resolutions you expect your page to be viewed.
<span class="off">!-Start Block to Shift Comments To Center-!</span>
<style>
{!-Change the top px value as needed. This is distance B on the chart-!}
table.friendscomments {position:relative; right:180px; top:5px;}
table.friendscomments {width:475px !important;}
table.friendscomments td, table.friendscomments table {width:100% !important}
table.friendscomments table table td {width:auto !important;}
</style>
<span class="off">!-END Block to Shift Comments To Center-!</span>
You can try increasing the width of table.friendscomments.As you do, you will notice the following:
- In IE it shifts the whole profile to the left.
- In FF it shifts the left column to the left, widening the gap between the right and left columns.
Solution 2 (Modified to use Distance B instead of Distance A. Thanks to Ralf for making me aware that absolute positioning could be used without setting a top value or changing the vertical position of the element).
Use absolute placement to move the comments horizontally only; maintaining their current vertical position.
IF distance B is positive, create a top margin in the comment space, equal to or greater than distance B.
Negatives:
Requires that the bottom links be removed. WARNING: I have recently learned that some profiles are being deleted due to hiding the bottom links. For this solution I recommend AGAINST hiding the bottom links. I will have new code for this soon.
If you have used background coloring for your main table, you comment space will now stick out below that table, giving an "off" appearance. However, you can fix this by using the body background color which is the same.
Positives:
This strategy takes far less code than 3 or 4.
This strategy relies on Distance B, which is usually the smallest and most consistent of all the distance choices.
If your friend space (or other content in your right column) grows, it will automatically push the comment space down to accommodate.
Logically removes the comments from right column, so they can be made wider without distorting the page alignment.
Preparation:
Measure Distance B.
If it is negative, and you expect it to remain negative, then no use of this distance is required
If it is positive, you will need to use this as a top margin to the comment space.
I have this values shown in Bold, in the below code.
Set it to 0 if your value for B is Zero or negative.
<style>
{!-use top-margin to move comments down distance B -!}
table.friendsComments {margin-top:255px;}
{!-Move comments to center and widen-!}
table.friendsComments {position:absolute; left:50%; margin-left:-350px; width:700px !important}
{!-widen sub-tables in comment space-!}
table.friendsComments table, table.friendsComments td {width:700px !important}
{!-adjust td level which holds actual comment-!}
table.friendsComments table table td {width:auto !important}
{!-remove bottom links-!}
table div {display:none;}
{!-restore ad banner and main content divs-!}
div table div, table table div {display:block}
</style>
[Solution 3 Pending]
Solution 4 This strategy relies on distance D.
First move the entire block (Friends, comments, calendar) to the bottom center. I do this by closing tables (and re-opening them to maintain balance). This causes the section to fall into place, just underneath the bottom of the left column, and above the bottom links.
Next I use absolute placement to move the friends (and calendar if you have one) back to their original location. This causes the comment section to move up and place itself directly under then left column and just above the bottom links.
To determine the absolute placement for the friendspace measure distance D (as shown in the picture). My values ranged from 733px to 800px (using 2 computers, both IE and FF on each computer, with different resolution and dpi settings).
Because I have enough space in distance C (see picture) for my friendspace to fit, while allowing enough space to accommodate variance among the different computers/settings, this solution works pretty well for me.
I use 808px (to allow an 8px top margin).
Place this code at the bottom of the "To Meet" section. Modify the value shown in bold to suit your profile.
<span class="off">!-Start Code To Center Comments-!
!- First Center the whole block, friends and comments-!</span>
</td></tr></table>
</td></tr></table>
</td></tr></table>
<table class="myTclassFC"><tr><td>
<table class="off"><tr><td>
<table><tr><td>
<span class="off">!-Start style block to go with center comments-!</span>
<style>
{!-remove carriage returns between friend and comment tables-!}
table.myTclassFC br {display:none}
table.myTclassFC table br {display:block;}
{!-move friends back to their location on the right-!}
{!-the value of top is distance D shown in the picture-!}
table.myTclassFC table.friendspace {position:absolute; top:808px; left:50%; margin-left:-50px; _margin-left:-60px;}
{!-Adjust the top px value in the below line IF the length of your friends space is longer than length C in the picture. -!}
table.friendscomments {position:relative; top:0px; left:0px;}
{!-Increase width of comment table-!}
table.friendsComments {width:800px !important;}
table.friendsComments td, table.friendsComments table {width:100% !important}
.friendsComments table table td {width:auto !important;}
{!-Control size of pictures and links in comments -!}
table.friendsComments table table td img {max-width:100%;}
</style>
<span class="off">!-END block to center comments-!</span>
Results:| Computer 1 FF | Computer 2 IE different resolution and dpi |
![]() | ![]() |
Same solution as above, but with a calendar
If you used the solution above (solution 4), and you had a calendar showing, it is probably now sitting just above your comments (bottom center).
You can use the same technique to move the calendar that was used to move the friends.
The calendar does NOT have its own class, but it is the only table, at this level:
myTclassFC table
Which does not have its own class.
Therefore I can address it this way, and then reverse the effect at levels
myTclassFC table.friendsComments
myTclassFC table.friendSpace
Now it is easier to see why I used the class, and explicitly specified it when I moved the friendSpace.
Look at the following page:Page showing Comments Bottom Center and Calendar Top Right
To make this layout work, I choose to keep, on the right side of the profile, only those items which sized consistently in the multiple browsers, resolutions, and dpi settings I was using. Anything that has the size defined, based only on px values, will do this.
I moved my Blurbs (About Me) to the Left Column. I replaced my Blogs with a picture.
I then turned my Extended network invisible {visibility:hidden}, to make room for my calendar.
I then pasted in this style block (it can go almost anywhere, I put it at the bottom of my meet section, just below the style block for centering comments:
<span class="off">!<style>
{!-move Calendar Top Right in place of Extended Network-!}
.extendedNetwork {visibility:hidden;}
.myTclassFC table {position:absolute; left:50%; top:165px; margin-left:-50px; _margin-left:-60; border:3px silver solid}
{! maintain static position of other stuff effected by above !}
.myTclassFC table.friendscomments, .myTclassFC table table {position:relative !important; top:0px; left:0px; margin-left:0px; border:none;}
{!- no code required here for table.friendSpace only because we have already positioned it-!}
</style>
[Note: All of the above assume the left column is longer than the distance from the top of the page to the bottom of the blurbs (the right column minus friends and comments). If this is NOT the case, then you may want to consider a layout more like this:
Friend And Comments Side by Side
or This
Center Friends and Comments]
Thank you for visiting, have a nice day
codes ? Is not code plural already? Prior to myspace I had never seen the word code pluralized to codes, when discussing software source code (or is it source codes?)
Center friends comments only
Can I center my comments on myspace, Yes
You can center friends comment table without centering friends
Center comments without hiding bottom links
center comments show bottom links
codes ? Is not code plural already? Prior to myspace I had never seen the word code pluralized to codes, when discussing software source code (or is it source codes?)
Center friends comments only
Can I center my comments on myspace, Yes
You can center friends comment table without centering friends
Center comments without hiding bottom links
center comments show bottom links
Labels: myspace comments friendsComments



24 Comments:
I used the center comments code, and It worked. However, in IE the photo comments were tiny. In FF they were normal size. Is there a something in the code I can change?
Jason,
The problem with IE is that is does not recognize the max-width (or max-height). FF does.
Therefore in IE I know of no way to control the size, without setting ALL link images the same size.
We can set the link images, to a different size than the non link images.
However all non link images must be the same size as each other; AND all link images must be the same size as each other.
The friend pictures are link images.
We also have the option of setting size based on a percent of the column width.
Using this we can make the friend images smaller than the link images in the comment column.
However, there are quirks in this solution.
IT still forces all link images, in a particular column, to the same size.
So it is not ideal.
My personal favorite solution is just to make all images tiny, I don't like them taking up a lot of space anyway.
My next favorite is overflow:hidden.
Put the whole space into a div, and then size the div, use overflow-x: hidden and just chop off any images which are so wide as to throw off your profile.
If you do this, you then need to float any links, which are now to the far right, back to the left.
My other favorite is Comment pre-approval.
If someone leaves a comment with a large image, don't approve it.
This is quickly becoming my favorite as these pages take longer and longer to load.
Awesome script really appreciate it! I've been adjusting some of the px width's and everything is coming along nicely. Is there no way to allow the images my friends post to be the intended size? Will this effect videos as well?
Thanks for your help!
I really want to know how to make the right-hand side of my myspace [[the one with "About Me", Comments, etc.]] skinnier and make my "General" section on the left-hand side wider, so that I can fit 160X160 or at least 130X130 px. icons two across. The link to my myspace is www.myspace.com/angelicdevil7794. Help much appreciated!
Jane
You can use my code for making a skinny profile, and just change the numbers.
You can change the full table width from 513 to 800 (or even just remove those blocks).
Then change the 200 I have set for the left column to 480.
Leave the right column set to 300.
You may then want to do some more adjustments.
Play with the numbers.
skinny profile
Help! I used your code to move my center my comments section below all my tables. It worked beautifully ... except that it sent the my friends space flying ... into the about me section. It's just sort of floating there ... happily. Can you help me fix it?
Here's my URL if that helps ...
http://www.myspace.com/lindashatch
Thanks so much for your help! ... Planning on putting a link to your great site on my page. Again, thanks for your help. Linda.
Linda
remove this:
table.myTclassFC table.friendspace {position:absolute; top:808px; left:50%; margin-left:-50px; _margin-left:-60px;}
Your right column is longer than your left column, after the comments are removed.
This means that you don't want to use absolute placement on your friends.
If you don't want your friends centered with your comments, and you want to keep the bottom links, you can move both sections bottom center and then slide the friends back to the right using relative positioning.
table.friendSpace {position:relative; right:100px;}
But do not use absolute, when your right column is that much longer than your left column.
You're an angel. Thanks so much Eileen. The solution you gave me worked. All I have to do is widen the friends space and it will look ok.
Can I ask you one more question? I'd like to have a box under the Interests box but can't figure out how to do that.
Can you tell me?
Thanks so much. Linda.
linda
Thank you.
Instructions for creating a table under the interests section can be found here:
Custom table under Interests Table
The above article explains how to create a custom details table.
If you use those instructions and do NOT hide the details table, you have a custom table between the interests and the details.
Argh! Eileen? Can you help me once more? I'm having a heck of a time trying to fill the space under my interests table down to my friends space. I've looked at the code you pointed to but I can't figure it out. Is there a simple way to fill that space?
Thanks!!!
Linda.
hey eileen ur code worked perfectly bt in moment i have loads of comments the page goes really big and we have to scroll all page till we get the link add comment is any way put change the link before stay on the bottom goes 2 the top?? like we need 2 scroll all page 2 add another comment or add a scroll box 2 centered comments? would be easier 4 every1 xD
Hey Eileen, thanks for the code.. it works great... but how can i get the ADD COMMENT box to move from the bottom left to the top part of the comments where it was before? can you please help me with that? thank you.. cath
thank you very much. was finally able to slim up my profile with this code
Solution 4 worked for me ... THANK YOU very much. Your instructions are very well organized, and easy to follow. Once again THANK YOU.
HI
do you know how to do
Transparent layers on a pic that links to another site?
for example on this myspace page at the very top of the page there are:
http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=62457785
"ADD","MESSAGE","PICTURES" etc
If you can help me that would very grateful
Thank you
IT WORKED!!!you sweet sweet man!Thank you
Perfect, thank you
i had to tweak it a lil but it k
thank you
Thank you so much for this great code! It works beautifully and it is just what I wanted! Thanks a lot!!!!
thank yu soo much
It worked really well for me but when i am using the B style one the comments go all the way down to the bottem of the page, is there anyway that i can have both friends and comments side by side while using the B code and only showing about 3 comments?
ive tried to use the codes that you have put up about showing the last comments but it didnt work for me. can you please help
It worked really well for me but when i am using the B style one the comments go all the way down to the bottem of the page, is there anyway that i can have both friends and comments side by side while using the B code and only showing about 3 comments?
ive tried to use the codes that you have put up about showing the last comments but it didnt work for me. can you please help
im happy that the code for centering comnts. worked but do you have a code that could put the comments in a scroll box that keeps the comments centered?
No,
Putting the comments in a scroll box, without including the friends in the same scroll box, is not possible via css.
One would have to write a app to do this.
I don't know if anyone has yet.
Hey
I need some help with my myspace.
How can i move down my (band site) friends and comments section. I need to make room for some pictures etc.
If I just add my pictures now they just keep runnig (layered) into my friends and comments.
All the best
Juss from Estonia
Post a Comment
Links to this post:
Create a Link
<< Home