homepage Welcome to WebmasterWorld Guest from 54.147.196.159
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Having a movable div that floats
coachm

5+ Year Member



 
Msg#: 4556427 posted 1:50 pm on Mar 19, 2013 (gmt 0)

I'm not exactly sure how to explain this. Let's say I have a 250x250x div (that holds an ad), that I currently have at the top of the page.

What I want to do is have more flexibility so that I can change where in the page (vertically) it appears via css to test various locations. I've been trying to do this using various positioning options, but all I can get is the div to sit on top of the larger text block, rather than it floating and the large text block making room for it.

I don't want to move the code itself. I just want to be able to make it appear lower or higher on the page simply by altering the css.

This should be possible? I've worked on this over the last while on and off for months (ok, it's a learning experience), but I simply can't get it.

Can anyone point me in the right direction?

 

rainborick

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4556427 posted 3:39 pm on Mar 19, 2013 (gmt 0)

Sorry, but you can't eliminate the relationship between where your content resides within an HTML document and its effect on how adjacent content is displayed using CSS alone. You could, however, modify the document itself with JavaScript and move selected sections of HTML from one location to another.

coachm

5+ Year Member



 
Msg#: 4556427 posted 6:47 pm on Mar 19, 2013 (gmt 0)

Thanks Rainborick, at least I can stop struggling with doing it that way. Since I'm not a javascript programmer, any idea if there's some code I can scrounge to try to modify.

The task, on the surface of it is simple -- to have a block that the main text will wrap around, and to be able to move the block occasionally with respect to how far down the page it is displayed. It's primarily to get some ads from the top to the middle, without actually doing the whole thing manually for thousands of pages.

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4556427 posted 10:13 pm on Mar 19, 2013 (gmt 0)

I don't want to move the code itself. I just want to be able to make it appear lower or higher on the page simply by altering the css.

Floats by definition display as soon as they can. Either right away, or after any preceding floats are finished; that's the only variable. So you can only move it by physically moving the code.

It may help to remember that HTML+CSS isn't a programming language. It's "only" a fairly sophisticated word processor.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved