Jump to content

Web Design Discussion


Recommended Posts

Is it possible to put content in a .css file?

I don't want to get into a philosophical discussion about this. I just want to know if it is possible. So, is it?

I beleive you can use javascript in CSS, in which case you can always use such things as document.write, but I don't know the limitations or if it is supported at all.

Edit: You can also use php CSS, just giving the file extension .php instead of css and using the normal opening and closing tags: <?php ?>

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former"

[ dA Paint.NET Chat :: Yata on dA ]

Link to comment
Share on other sites

Is it possible to put content in a .css file?

IMO that goes against the whole philosophy of CSS and AFAIK is impossible. If you are looking to add a consistent header to web pages, I recommend:

<?php include 'header.php'; ?>

Although that is just from memory and may use incorrect syntax.

KaHuc.png
Link to comment
Share on other sites

Is it possible to put content in a .css file?

I don't want to get into a philosophical discussion about this. I just want to know if it is possible. So, is it?

IMO that goes against the whole philosophy of CSS and AFAIK is impossible. If you are looking to add a consistent header to web pages, I recommend:

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former"

[ dA Paint.NET Chat :: Yata on dA ]

Link to comment
Share on other sites

^ So, in other words: :roll:

;)

To BB:

I guess it all depends upon what you mean by "content". As Yata mentioned, you can use the PHP extension and write a script that reads passed variables or whatnot and outputs the CSS in echo statements, but when a CSS file is linked in the header, it is attached to the document and parsed separately. It's also a different MIME type, so it's interpreted as CSS, not as HTML.

Would you care to elaborate on what type of content you're trying to include?

I am not a mechanism, I am part of the resistance;

I am an organism, an animal, a creature, I am a beast.

~ Becoming the Archetype

Link to comment
Share on other sites

Just HTML including text and links.

In that case use the php function Sabrown posted. All you do is insert:

<?php
include 'filename.extension';
?>

Wherever you want your inserted HTML to go. I use it all the time. I just put a bunch of those all across my base page template and use them as needed. That way, so long as you have them in place, it works just as CSS, except grabbing content from the file. It's best to use a .inc or obscure extension so search engines don't cache pieces parts of pages. Or you can protect a directory of these included files with a HTACCESS file and specify a Deny From All inside of it. PHP will still be able to read from the files even with the Deny From All active.

http://us.php.net/include/

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former"

[ dA Paint.NET Chat :: Yata on dA ]

Link to comment
Share on other sites

Just HTML including text and links.

Nope, that part won't work. You can put CSS into HTML anywhere using a

If your server runs PHP, you can use an include-like statement (require_once is a good option for objects that must be on a page). If it doesn't there's ASP include statements (I think the function is actually called "import", but I've not used ASP in ages), and then there's SSI, which uses an ASP-like include statement without requiring a programming runtime environment. However, SSI has to be enabled on the server before it'd work.

I am not a mechanism, I am part of the resistance;

I am an organism, an animal, a creature, I am a beast.

~ Becoming the Archetype

Link to comment
Share on other sites

I had two websites that I made. One for a lacrosse team:

http://nelightninglacrosse.com/ (It was paid for) I used some PDN stuff here. I learned most of the codes on my own, so I never really did anything complex, unfortunately.

and another one for a college assignment:

http://geocities.com/hlnl56/letters.html

The lacrosse team never worked out (I'm so upset!!) and the geocities one is free and I can't afford buying a domain. I'd like to build more websites, but I have no time. There, that's my story. :(

@Sabrown: You've got very good design, by the way. I like the way everything's positioned. Great job!

sig-1.png
Don't spit into the well, you might drink from it later. -----Yiddish Proverb

Glossy Galaxy Ball---How to Make Foliage
My Gallery

PDN Fans--My DA

Link to comment
Share on other sites

I just made a new site. I felt a little lazy, so I used a pre-made template, but I usually make my own. However, the stuff I HAVE made myself is not very intelligent, mostly rants, and a few photos of me, so...

http://www.clique2008.webs.com/

How could I improve?

I was thinking of adding a guest page, and having a universal password to give certain people who are friends but not in the Clique.

Hi. Yes. No. Uh-huh. Of course. Well, I don't know what you're sayin', but if you wanna leave a message at the beep...

Link to comment
Share on other sites

I find boring design is generally the best, you want people to be able to read your content, not be wowed by over the top trickery.

dA

Son, someday you will make a girl happy for a short period of time. Then she'll leave you & be with men that are ten times

better than you can imagine. These men are called musicians. :D

Link to comment
Share on other sites

I find boring design is generally the best, you want people to be able to read your content, not be wowed by over the top trickery.

I disagree - a bad design can make content painful to look at. A design should however, in my opinion, be designed to allow the user to focus on the content. Windows Aero and the new PaintShopPro theme were both designed with this in mind.

Just my 20 pence.

KaHuc.png
Link to comment
Share on other sites

I just spent a week creating myself an extensive website. Only to upload it to 110mb and half the pictures are missing and the design layout shot. I'm extremely annoyed but i will try again. before i do should i keep goin with the current design or start from scratch.

Website.jpg

large image

So should i start over or should i keep going with it

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

 Share

×
×
  • Create New...