mySpace Simple Div Float Floating Divs
Simple Div Overlay Using Inner Divs
The main difference between this strategy, and my other strategy, is the use of inner divs instead of a core image.
We will be building this:
My Space Page with Child Div Containers inside an Outer Core Div
My other strategy consisted of one or more core images, which made up what I called the core of the div.
Content was then placed on top of the Core using absolute placement.
The code for this strategy can be found here:
MySpace Simple Div Ovrlay
This strategy replaces the core image with multiple inner divs. These divs are placed, allowing them to fall naturally into the position we want them, and then
floated either left or right (or not at all).
This allows us to create inner containers, which can change height, as content is added, without messing up our layout.
Some of the content from the default page, can be easily placed into an inner div, which is opened BEFORE that content occurs, and closed AFTER that content occurs.
There are limitations, on exactly where we can place the default page content, and still allow it to grow without messing up our layout.
In the below example I will do the following:
- Remove or hide all of the default page content (we will bring some back at a later step)
- Create a core div, which will serve as an outer container (parent) to all of my inner content
- Create multiple inner containers (div blocks)
- Position each of these inner containers without the need to use absolute positioning.
- Build one of the inner div containers so it wraps around our blogs. This allows our blog content to grow.
- Position the friends and Comments at the bottom, in such a way as to allow them to push down the bottom links as they grow.
1) Use the code block in "Step 2: Hide the Default Page Content" of this article:
MySpace Simple Div Ovrlay
Don't worry if you don't want to hide everything, we will bring back what we want later. I like to start by getting it all out of the way.
2) Use the code block in "Step 3: Create a Core Div to put our our Content in"
From the above page. Put this code in the Hero Section.
If you are folling the band tutorial, put this code into the Band Members Section.
Notice I left a gap between these span blocks (which I use for comments since myspace removes anything using official comment syntax):
!!-----START Core Custom CONTENT------!!
!!-------END Core CUSTOM CONTENT--------!!
We will be placing the next several code blocks between the above two lines.
This will put the content inside our core div (myCoreDiv).
Look at this inline style command, that is included with the open tag for the core div:
<div class="myCoreDiv" style="width:900px; height:auto !important; border:1px violet solid; position:relative; top:0px;
overflow:hidden; z-index:0;">
Change the 900 to the desired with for your core div.
In my example I am using 800
Create Top Left Div
If you want the div to grow to accomodate added content, or if the content does NOT size the same cross-platform, you want to set height:auto
If you want the div to be an exact height, you want to set the height to a px value.
If you set a px value, and your content does not fit, you have a high risk of cross browser issues. Y
Create Top Right Div
It is possible to put more than 2 containers on the same level. You can float multiple containers in either direction, as long as there is room.
I will cover more complicated examples later.
When we are done placing our divs in our top row, we need to do a clear. IE and other browsers treat Float differently. Float causes a container to not take up
space (similar to absolute placement). If we Clear, we can solve this issue.
Open Center Div (which will hold our blogs)
IF I want my next div to sit below BOTH the left and right div, I clear both. If I only want it to sit below my Right div, I clear Right.
For this example, I will clear both:
Because I want this next div to include content from the default page, I am going to open the Div in one section, and close it in another.
The blogs occur AFTER the Interests section and BEFORE the blurbs section (on the band page after the General Section and Before the Bio section).
The blogs are NOT static in size, either across browsers or across time.
Therefore I want them in a space, which can grow with them.
This is also a good strategy to use for placement of the shows.
I will open this div in the hero section. This code goes INSIDE our Core Custom Content Block.
Earlier, when we hid all of the default content, we hid our blogs.
We will now unhide them.
Remove the following line of code:
Your blogs should now show up inside the div you just created. They should automatically center.
IF you do not want them centered, but instead want them right or left, you can move them using relative positioning.
However, for this particular example, I want them centered in this space.
Open same number of tables we closed
The code is already in the code block we pasted in earlier.
It is always a good habit to keep the close and open table/row/cell tags balanced.
Each time I put content, which I want at the level of my Core Div, I take things up to the level of One Table Deep.
I do the needed close table/row/cell commands in each cell, where I enter this type of content.
This is important, because each time we leave one of the cells (where we are allowed to enter data) the code encounters several close tags. We need these tags to
map correctly.
Prepare the the "To Meet" Section For continuation of our Div
The reason I am choosing my Meet section, instead of my About section, is that it is the LAST data entry point. If I leave this section, with a div open, that div will suck in my friends and comments.
When we left the Hero section we had 2 divs open. Both of these divs are still open.
These Divs are ONE table deep.
The cell we enter data in, in the Meet section, is FOUR tables deep.
Therefore we must close three levels of table/row/cell before we close this div.
I start out this section by closing enough tables/rows/cells to take me OUT of the Blurbs class (which we rendered display:none} and one table deep.
I then close the div (myDivCenter).
I place the below code block in the "To Meet" section (or the "Bio" on the band page):
Create Lower Center Div
Place the below code block just below the last block you placed in the "To Meet" section:
Notice this div stretches the entire width of the parent div.
Next put in the content.
Notice that the div automatically grows as content is added, pushing down the bottom link area.
Once your content is entered, close the Div.
After closing the Div,
Open the same number of tables/rows/cells that we closed at the top of this section.
When I am done with a section, I like to put in something to indicate this is the end of the custom code in the section.
This makes it much easier to find the code, after it is merged with the myspace default code.
I paste this block at the end of the "To Meet" section:
Recover Friends and Comments
Our core div is still open.
If we now remove the code which has rendered our friends and comments {display:none} they should show up after the last div we closed, and inside our core div, and
above the bottom link area.
Locate and remove the following lines of code:
The main difference between this strategy, and my other strategy, is the use of inner divs instead of a core image.
We will be building this:
My Space Page with Child Div Containers inside an Outer Core Div
My other strategy consisted of one or more core images, which made up what I called the core of the div.
Content was then placed on top of the Core using absolute placement.
The code for this strategy can be found here:
MySpace Simple Div Ovrlay
This strategy replaces the core image with multiple inner divs. These divs are placed, allowing them to fall naturally into the position we want them, and then
floated either left or right (or not at all).
This allows us to create inner containers, which can change height, as content is added, without messing up our layout.
Some of the content from the default page, can be easily placed into an inner div, which is opened BEFORE that content occurs, and closed AFTER that content occurs.
There are limitations, on exactly where we can place the default page content, and still allow it to grow without messing up our layout.
In the below example I will do the following:
- Remove or hide all of the default page content (we will bring some back at a later step)
- Create a core div, which will serve as an outer container (parent) to all of my inner content
- Create multiple inner containers (div blocks)
- Position each of these inner containers without the need to use absolute positioning.
- Build one of the inner div containers so it wraps around our blogs. This allows our blog content to grow.
- Position the friends and Comments at the bottom, in such a way as to allow them to push down the bottom links as they grow.
1) Use the code block in "Step 2: Hide the Default Page Content" of this article:
MySpace Simple Div Ovrlay
Don't worry if you don't want to hide everything, we will bring back what we want later. I like to start by getting it all out of the way.
2) Use the code block in "Step 3: Create a Core Div to put our our Content in"
From the above page. Put this code in the Hero Section.
If you are folling the band tutorial, put this code into the Band Members Section.
Notice I left a gap between these span blocks (which I use for comments since myspace removes anything using official comment syntax):
!!-----START Core Custom CONTENT------!!
!!-------END Core CUSTOM CONTENT--------!!
We will be placing the next several code blocks between the above two lines.
This will put the content inside our core div (myCoreDiv).
Look at this inline style command, that is included with the open tag for the core div:
<div class="myCoreDiv" style="width:900px; height:auto !important; border:1px violet solid; position:relative; top:0px;
overflow:hidden; z-index:0;">
Change the 900 to the desired with for your core div.
In my example I am using 800
Create Top Left Div
If you want the div to grow to accomodate added content, or if the content does NOT size the same cross-platform, you want to set height:auto
If you want the div to be an exact height, you want to set the height to a px value.
If you set a px value, and your content does not fit, you have a high risk of cross browser issues. Y
<div class="myDivTopLeft" style="width:398px; height:auto; float:left">
Content for Top Left Div Goes Here.
</div>
Create Top Right Div
<div class="myDivTopRight" style="width:394px; height:auto; float:right">
Content for Top Right Div Goes Here.<br>
I can put anything I want here, as long as it has a width of 394px or less.
This section is set to height:auto.<br>
As it grows it will push down the content below it, if needed.
</div>
It is possible to put more than 2 containers on the same level. You can float multiple containers in either direction, as long as there is room.
I will cover more complicated examples later.
When we are done placing our divs in our top row, we need to do a clear. IE and other browsers treat Float differently. Float causes a container to not take up
space (similar to absolute placement). If we Clear, we can solve this issue.
Open Center Div (which will hold our blogs)
IF I want my next div to sit below BOTH the left and right div, I clear both. If I only want it to sit below my Right div, I clear Right.
For this example, I will clear both:
Because I want this next div to include content from the default page, I am going to open the Div in one section, and close it in another.
The blogs occur AFTER the Interests section and BEFORE the blurbs section (on the band page after the General Section and Before the Bio section).
The blogs are NOT static in size, either across browsers or across time.
Therefore I want them in a space, which can grow with them.
This is also a good strategy to use for placement of the shows.
I will open this div in the hero section. This code goes INSIDE our Core Custom Content Block.
<div class="myDivCenter" style="clear:both; border:1px green solid" >
(You can replace this with a custom Blog Header or Remove this text. This section will grow as blogs are added.)
Earlier, when we hid all of the default content, we hid our blogs.
We will now unhide them.
Remove the following line of code:
table.latestBlogEntry {display:none;}
Your blogs should now show up inside the div you just created. They should automatically center.
IF you do not want them centered, but instead want them right or left, you can move them using relative positioning.
However, for this particular example, I want them centered in this space.
Open same number of tables we closed
The code is already in the code block we pasted in earlier.
It is always a good habit to keep the close and open table/row/cell tags balanced.
Each time I put content, which I want at the level of my Core Div, I take things up to the level of One Table Deep.
I do the needed close table/row/cell commands in each cell, where I enter this type of content.
This is important, because each time we leave one of the cells (where we are allowed to enter data) the code encounters several close tags. We need these tags to
map correctly.
Prepare the the "To Meet" Section For continuation of our Div
The reason I am choosing my Meet section, instead of my About section, is that it is the LAST data entry point. If I leave this section, with a div open, that div will suck in my friends and comments.
When we left the Hero section we had 2 divs open. Both of these divs are still open.
These Divs are ONE table deep.
The cell we enter data in, in the Meet section, is FOUR tables deep.
Therefore we must close three levels of table/row/cell before we close this div.
I start out this section by closing enough tables/rows/cells to take me OUT of the Blurbs class (which we rendered display:none} and one table deep.
I then close the div (myDivCenter).
I place the below code block in the "To Meet" section (or the "Bio" on the band page):
<i class="off">!-go up to level one table deep-!</i>
</td></tr></table>
</td></tr></table>
</td></tr></table>
</div> <i class="off">!-Close div.myDivCenter-!</i>
Create Lower Center Div
Place the below code block just below the last block you placed in the "To Meet" section:
<div class="myDivLowerCenter" style="border:1px white dashed; height:auto">
Notice this div stretches the entire width of the parent div.
Next put in the content.
Notice that the div automatically grows as content is added, pushing down the bottom link area.
Once your content is entered, close the Div.
After closing the Div,
Open the same number of tables/rows/cells that we closed at the top of this section.
When I am done with a section, I like to put in something to indicate this is the end of the custom code in the section.
This makes it much easier to find the code, after it is merged with the myspace default code.
I paste this block at the end of the "To Meet" section:
</div> <i class="off">!-close div.myDivLowerCenter-!</i>
<i class="off">!-open same number of tables we closed -!</i>
<table><tr><td>
<table class="off"><tr><td>
<table class="off"><tr><td>
<i class="off">!-End custom code in Meet-!</i>
Recover Friends and Comments
Our core div is still open.
If we now remove the code which has rendered our friends and comments {display:none} they should show up after the last div we closed, and inside our core div, and
above the bottom link area.
Locate and remove the following lines of code:
table.friendsComments {display:none}
table.friendSpace {display:none}
Thank you for Visiting; Have a Nice Day :-)
Labels: myspace div overlay Simple Float
31 Comments:
is there a way to put a div below the comments section and above the bottom links area, i have tried tho it overlaps the friends comments, i have also tried absolute and will push down below the links area. thanks
Hello... im just completely confused........
i got as far as hiding everything.. then i put the overlay and my picture is my background which i created...
now i just want to out a big scroll box in the middle of the profile (in the space provided) and put everything in there.... whatever i want...
how do i do that??? PLEAASSEE
;)
ok,
So you got through the "hide everything" step
Did you do the step where you put in the core div
Where it has this:
!!-----START Core Custom CONTENT------!!
!!-------END Core CUSTOM CONTENT--------!!
Between those two lines, you can put in whatever you want.
If you want to make the div scroll, you want to give it a set size, and then set overflow to scroll.
Locate the line of code which has this in it:
div class="myCoreDiv" style="width:900px; height:auto !important;
Change height:auto
to
height:600px; overflow:scroll;
You can use some other value, besides 600.
alexintexas
Yes there is.
Click Here
trying to put a div scrolll box in the div overlay box i replaced my general table... and I can't figure it out... everything I try the code just makes the whole general table/ div overlay disappear... any help?
sorry the site is: http://www.myspace.com/bthtest
Thanks Eileen,
You helped me once again.
I do have a question or two though.
1. I would like to spread my friends a little from the "bunched up" look they have now.
2. I would like to remove the little box over the comments without losing the borders separating the individual
comments themselves.
Thank in advance I know the recent changes @ M.S. may have added to how busy you are.
Arlie.
arlie
Can you follow the article I have for styling the friends.
It pretty much forces all the spacing, and although my example is for a compressed friend space, by altering values, you can use it to make a more expanded friend space.
Styling and Sizing the FriendSpace
ulser tahed
Add a style block to your div tag.
You can either do in as an inline style command (as my example below does) or create a separate style block.
<div class="myGeneral" style="height:300px; width:300px; overflow:scroll; overflow-x:hidden;">
That was GREAT!
It took all of about 5 min (including load times (dial-up) to get them the way I want.
It did however move the comments to the left of center. I looked at the tutorial, but didn't see anything in that regard. I'll do a search after I finish these KUDOS
Thanks bunches. I'd send you a kiss but my wife is looking
Not sure what I'm doing wrong
The ad banner and the google search box does not show with IE6.
It is that way with both profiles I'm working on.
The RiverHouse
and
The Shuffle Hounds
also this is showing up in IE6
!!-open same number of tables we closed-!! !!---End custom code in Meet---!!
Is it just my browser?
I'd hate to get bumped over a misunderstanding.
Something in the influences section is causing my text to overlap
when i remove this it doesnt overlap anymore....does anyone have any ideas...how i can resolve this issue
... i used the overlay with profile view showing for bands
I have a couple problems. How do I change the background for each container. The bg's are showing up white. I removed the text for friendspace but it is leaving the orange box, how do I get rid of that. And I like to put a couple spaces between my blog header and the center bottom container. thanks for the help in advance.
Hey Eileen.
I've followed your guide so far and it's brilliant. But I've reached a point where I'm quite confused and I don't know how to do this...
First off this is the profile I'm working on at the moment: http://www.myspace.com/loewenzahn23 It's my band's new profile.
1.) Everything seems to be ok except for the two big blank boxes in the middle. One is supposed to be the "band info". I have created a new div with the text but it always ends up at the very bottom of the page and I can't move it. What to do?
2.) I need to put a YouTube video in the other box. Is this possible?
I would really appreciate your help!
Thanx a lot.
Marc
Bödi,
It looks like what you are doing is closer to my
band div overlay strategy, that uses a core image, than the floating div strategy.
This is fine, as long as you expect the content to be reasonably static in size.
yes, you can move that block of text, into one of the boxes.
Give it a position clause
position:absolute; top:355px; left:13px
Change the width to less, so it fits in the box.
To put a youtube video in the other box, wrap it in a div, and use position absolute, similar to what you do for the text block.
You may also want to scroll your shows, so they do not overlap into the box below them, if they grow.
Great! It worked!! I tried that before but I think I set position:relative. It didn't work anyway.
Thanx a lot.
Now I just need to find a way how to format the text (I don't want it centered for example) and I might want to change the font...
Sorry to bother you again, but I'm stuck again. I've changed the layout a bit since it was a bit too boring. I left most of the code as it was and just changed the pictures.
I want to put a shadow at the bottom as well but I just can't figure out a way of doing this using a DIV.
This is the pic I want to use:
http://img93.imageshack.us/img93/4639/myspacebodybottomcu5.jpg
My other problem is hard to explain: look at the top menu. I wanted the dark middle part of the layout to fit into the 800 pixel width except for the shadow. How can I do that?
And why is the grey border of my band info DIV over the writing?
Sorry if I'm annoying but I just can't figure it out on my own.
Thanx.
Hi. I fixed the problem with the border across my text. At least in Firefox it's gone by using a simple "br /". I think in IE it's still not visible...
Can somebody please help me with the shadow pic at the bottom? I can't figure it out.
I'm still looking for someone to help with my problem. I'm trying to put an image with the bottom shadow at the very bottom of my main div.
And, even more important, the friends are placed really weird in IE. How can I fix that?
Someone please help me. I need to launch the new MySpace layout on wednesday latest as our new EP is coming out then!
Thanx.
Hi! Is it possible to somehow show the .profileInfo inside the core div? (I'm designing the profile page for a friend and I want her profile picture, screen name etc. to show automatically since he´s not so great with HTML/CSS). I have tried but can not figure out how.
Everything else is working terrific, great tutorial!
This post has been removed by the author.
This post has been removed by the author.
Hi, I've used your overlay a number of times and for some reason, the friends and comments won't show with this new one. What am I doing wrong? I copied only your code exactly and didn't add anything, to figure out what to do. Here's the link: www.myspace.com/jeanniesmyspace1
Any suggestions on what I need to fix? Thanks.
I used the code to hide everything but I want to unhide my blurbs section. The only problem is that everytime I do the bottom links stretch all the way to the bottom of my screen leaving my page with a lot on undesired white space between the botto links and my blurbs. I would also like to know how to unhide the left side of my profile.
Why do you want to unhide your blurbs section?
I don't recommend unhiding it.
I recommend creating your own content section, and putting in the headers you want.
Inside the core div, just create the content, you would otherwise put in your blurbs area.
Hey Eileen your tutorials are amazing but I do have one minor issue. I am working on a band profile and I get the top two divs open fine, then the central div. When I try to bring in the blog in that div it does bring in the blog but also the about and friends comments sections. I dont know if Im doing something wrong or if on a band profile the depth of these tables is different.
The myspace is
myspace.com/fierceprostudios
Hi, I tried a few options to see if I could figure it out but I'm still baffled. I put the page back up exactly as I read the code... so did I read something wrong?
If you could take a look, I'd be very appreciative.
http://www.myspace.com/jeanniesmyspace1
Hi - just wondering - do these div codes work for a "non-band" profile on myspace?
i'm super fried from trying to get this mailing list div into my left side div... i used your div to remove most of the left side and now I'm trying to put in a div mailing list and it will not work... not at all....
also while you're at it, any idea how I could move anything from my right into another text field and get it to show up in its same location?? i've run out of space (myspace error character limit - mainly cuase myspace tweaks the code and ads characters)...
heres the test page:
http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendID=321031840
when I test the code in bbedit it appears fine, but when I put it into myspace, nothing shows up
the player is misaligned in IE, i only use FF, but not everyone does.
When the Wow Gold wolf finally found the wow gold cheap hole in the chimney he crawled cheap wow gold down and KERSPLASH right into that kettle of water and that was cheapest wow gold the end of his troubles with the big bad wolf.
game4power.
The next day the Buy Wow Goldlittle pig invited hisbuy gold wow mother over . She said "You see it is just as Cheapest wow goldI told you. The way to get along in the world is to do world of warcraft gold things as well as you can." Fortunately for that little pig, he buy cheap wow gold learned that lesson. And he just wow gold lived happily ever after!.
Post a Comment
Due to Excessive Spam, I have turned on comment moderation.
Links to this post:
Create a Link
<< Home