/    Sign up×
Community /Pin to ProfileBookmark

Help understanding linking to a <div> in CSS…

Ok, I’m struggling with setting up my site layout.

I am not that familiar with CSS and came from the old school of table layouts and frames.

To me what is ideal is if I can have a <div id=”content”> for my content that will display in the content div regardless of what my layout is.

It seems I should only have to build a single page layout, and when clicking on an internal link have that linked page be an html file top open within <DIV id=”content>. So I can change my layout but don’t have to code the layout on every page, even if it is a simple <div id=”header”> <div id=”content”> <div id=”footer”>. I’d have to change ALL my content web pages then, which is what I really want to avoid.

I was able to do this using code from here:

[url]http://www.webdeveloper.com/forum/showpost.php?p=405143&postcount=8[/url]

But the problem is that the browser navigation buttons don’t go forward and back within my site. It takes it back to whichever page the user was browsing prior to arriving at mine. I basically want it to act like a link to a frame.

My google searches say to use an “iframe” command but then they follow up with, “but you should really do this with CSS” but don’t say HOW.

Check out this link. Sorry, it’s a mess at the moment, and ignore the content, it’s just filler for the moment, but go to the “articles” link and see what I’m talking about:

[url]www.notebooknerd.com/indexcss.shtml[/url]

A million tons of thanks in the form of kisses from your favorite fantasy actress/actor for helping!

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@svidgenApr 02.2009 — If you want the back/forward buttons to work (as well as make your site indexable) you need to use a server-side solution. For what you're currently doing, you may as well be using an iframe.

Are you at all familiar with any server-side languages, like PHP, Perl, ASP, Python, etc? You could probably even get away with using a compiled language like C or C++ if you're comfortable with one.

If you're not satisfied with an asynchronous solution and you're not familiar with any server-side languages, you'll just have to start copying and pasting ...

... oh, or you could use SSI.
Copy linkTweet thisAlerts:
@htwingnutauthorApr 02.2009 — I think I will go the iframe route. Unfortunately my server-side language skills are amateur at best. Like I said, my skills are from ten years ago. I am decent with html and javascript. Beyond that I'm a fish out of water. I'd LOVE to get into that stuff, as I always enjoyed programming, but just don't have the time to learn. Maybe after I get my MCSE (which I'm enrolled in class to get my MCSA currently). I'm an automotive engineer that has been unemployed recently after 14 years in the business. Now is my time to get into the IT field that I should have done ten years ago....

I am somewhat familiar with SSI, as have used it in the past, so may use that to the best of its ability, which is still somewhat limited IMHO.

So bottom line though, what you're telling me is that it is not possible with CSS?
Copy linkTweet thisAlerts:
@svidgenApr 02.2009 — So bottom line though, what you're telling me is that it is not possible with CSS? [/QUOTE]
Nope. As far as I know, you'll have to use JavaScript for any client-side solution.

Good luck with your new career path!
×

Success!

Help @htwingnut spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...