Jump to content

Sitewide linkbox possible with CSS?


kylecooper

Recommended Posts

Hello,

 

I have been coding CSS for years, now I need sort of a link box for featured sitewide links...

 

The box is like a cell and there would be links and their description in it...

I was wondering if one can do something like this in CSS...

 

Otherwise explained: it would look like a Google AdSense ad box...

 

Any ideas?

 

Thanks for helping!  :)

 

Link to comment
Share on other sites

 

  Hello Rilana,

 

  What I want to do is: a small cell (or table) which appears on every page of my site. The cell would contain a list of "reatured links". I will sell this ad space.

 

  My dilemma is:

-> I have 2.500 + pages and they're all HTML with CSS

-> I would like to have the same box (linkbox, like the Google ads box) on every page

-> Would like it if the box had an external source code...such as CSS, so that I won't have to manually insert the code into all 2.500 + pages...

 

  Imagine the box like this:

  http://www.myrasoft.com/activesearchengine/ASEGoogleAdsense1.GIF

 

  So, it'll be sitewide... I'd be able to edit it from a single file.

  And the result will be visible on every page....

 

  I just don't know how to do it...

    ??? 

 

 

 

 

Link to comment
Share on other sites

Its not really doable with CSS. You could hard code the links into every page and then style them with one CSS sheet, but you will still have to code the links into each page first.

 

This is better done with PHP or some other server-side language. Put the links all into one file and then include that file into each page at the bottom or what not. If you need to keep your files as .html, then you can either rename all your files with php and set up a mod re-write so that when someone adds .html it accesses the php file, or you can set up your server to parse html files as php.

 

Honestly, you made a big deal about having used CSS for years, but I'm suspecting you aren't using as well as it could be used, or you would know this. A book or two on CSS probably would be a good thing.

Link to comment
Share on other sites

 

  ;) I've been using CSS, but not at a professional level, indeed...

  Had a few very simple sites.

 

  Until now I only coded CSS simply for text style, background.

  It's the first time I am using the table-CSS method and I'm getting the hang of it now  ;D

 

  Hmm, yes, I guess PHP would be better for those sitewide links...

  But this is quite rare, I wonder if there are people on this forum who know how to do it...  :-\

Link to comment
Share on other sites

But this is quite rare, I wonder if there are people on this forum who know how to do it...

 

Its not a matter of knowing how to do it - it can't be done with CSS. You have to realize that CSS is for styling - it styles the markup. Effective usage of (X)HTML and CSS involves removing ALL styling from your markup - the (X)HTML - and then using CSS to style that markup. Its the separation of content and design. That's what CSS is made for.

 

What you want to do is add links to each page. But links are content/markup. So CSS cannot create them. It can only do things to them after they have been created - it can choose colors, fonts, positions, text design etc. All stuff that is design. But unless they are present in the original code, CSS cannot do anything to them. As the links consist of both (X)HTML and CSS, CSS cannot include them into each page, which is why you would need a server side language to be able to do this.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.