Jump to content

External CSS better for you?


dojo

Recommended Posts

When I first started designing, I used FrontPage and then Dreamweaver. The transition from a WYSIWYG editor was then done and I started using Crimson Editor, while also learning some CSS, so that I don't hog my code with useless styling. Then I found out it's even more elegant to have a separate CSS file and just 'call' it in the template.

 

Do you use external CSS too? Is it not something you'd care about?

Link to comment
Share on other sites

I use external CSS for sure. I think that it is more organised when you use external CSS because you don't need to type what style you want into every single HTML code you type. However, when I just want to make a minor modification to a HTML code and it doesn't have a ID or a class specified to it, I just use styling inside the HTML code. It just speeds things up.

 

Having external CSS also speeds up when you want to edit some part of your website's design without it making a huge difference to any other things.

Link to comment
Share on other sites

I use external CSS files all the time since they allow reusability of code. As Devilkid has already mentioned, external CSS also makes loading of webpages faster as the browser has to download the CSS file just once and load it from cache for subsequent pages. However it does require greater planning skills since you need to think about multiple pages or the entire website while coding. But once you get the hang of it, it becomes progressively easier and easier.

Link to comment
Share on other sites

I always use an external stylesheet for my templates. It's a lot easier to make changes to the overall design this way instead of having to go through each page and change the CSS on that particular page. This is essential for sites with more then 5 pages to them. It just saves so much time and effort to have an external stylesheet instead of having the styles embedded into the HTML. It's a good practice for EVERYONE, including beginners to use external stylesheets instead of having the styles embedded into the code itself.

Link to comment
Share on other sites

Since I usually reverse engineer web templates, I just followed whatever technique happened to be more dominant or prevalent. And if I based my design on a particularly good template, I will leave intact much of the CSS elements wherever they may be found.

 

Maybe, when I have several templates designed, I may think of separating CSS elements and packaging them in their own CSS file for reusability.

Link to comment
Share on other sites

External CSS for sure. If not for cleaner and more readable code then at least for caching the CSS to make your website run faster. This is an issue that is getting more and more important for SEO purposes as well. Google tend to favour fast loading sites these days in the SERP.

Link to comment
Share on other sites

  • 1 year later...

The only time I embed the CSS in the header of the page is when I am testing out some different CSS techniques, since it's just faster to save and preview as I'm working in Dreamweaver. Otherwise I have to keep saving two separate files, the HTML and the CSS file. Also, if I am using a certain script thatdoesn't allow me to attach external CSS files, I may have to use inline CSS or embedded CSS.

Link to comment
Share on other sites

  • 3 months later...

I used to use a lot of inline CSS when it first came out, but now I do everything I can to put stuff in external sheets. It makes keeping the websites consistent so easy and I am very big on consistency. Of course, occasionally inline styles are the best quick solution for something you don't think you will have to change and will only be needed within that page. 

 

HTML5 almost requires using external CSS sheets to be effective. At least, to me.

Link to comment
Share on other sites

  • Administrators

I used to use a lot of inline CSS when it first came out, but now I do everything I can to put stuff in external sheets. It makes keeping the websites consistent so easy and I am very big on consistency. Of course, occasionally inline styles are the best quick solution for something you don't think you will have to change and will only be needed within that page. 

 

HTML5 almost requires using external CSS sheets to be effective. At least, to me.

Yeah I'm bad about inline css when developing.  

 

Once the project is complete I should go back and move into the stylesheet, but I'm sometimes lazy :)  It's so easy during development just to put it inline rather than toggle over to another file, add the css then refresh and dump cache as the CSS doesn't always refresh via stylesheet like it does when inline.

Link to comment
Share on other sites

  • 2 weeks later...

If you aren't using external CSS files you're doing something wrong. That's one thing I hate when I'm using certain content management systems where the developers got lazy and just used HTML or inline CSS to style elements or forgot to put a class on a certain element I want to change. It makes things very messy and difficult when trying to theme things.

Link to comment
Share on other sites

I do indeed use external CSS. It's just a more organized way of doing things and it looks really messy when you mix up a whole bunch of CSS with HTML, even if it's short code. 

Though I do admit on being lazy sometimes and doing the css and html all internally when I'm testing some techniques, I think we should stick with doing it externally :P

Link to comment
Share on other sites

  • 6 months later...

I try and use external css as much as possible.

 

The only time I can't is HTML emails (grrr)

and for some internal tools,  that don't allow it either. 

 

But otherwise,  I use external sheets so I can reuse the code and that makes it easier to do site wide changes later on.

Link to comment
Share on other sites

External CSS is a must for me because I don't have to fill my HTML page with CSS. An HTML with solely HTML looks more organized to me and you can also edit easier. A seperate CSS file also allows for greater flexibility and customization.

 

Not to mention that if you plan to trash your website, you can create a template and sell it on one of those online marketplaces. That's actually what I did and I made some sales. 

Link to comment
Share on other sites

  • 7 months later...

If you're building a one-page website for a business or something it's easier to just write the style sheet inside the head of the document.

 

However on larger projects with many pages and tons of CSS I definitely find it better to include all CSS in external sheets and separate it from the pages themselves. It makes the CSS so much easier to manage and is a heck of a lot neater.

Link to comment
Share on other sites

  • 3 years later...

An external style sheet is ideal or useful when the same style is applied to many pages. I prefer to use this method because it makes easier to organized your files. With an external style sheet, you can change the look of an entire Web site by changing one file. you do not have to change your file if you are using inline style sheet. 
It is something that I would consider as it is really something simple that you want to achieve.  All you simply will need to do, copy the contact form template to your theme, add the custom css to that template, and style accordingly in your themes' style.css. Your theme will then always use this template.

Link to comment
Share on other sites

  • 2 months later...

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.

×
×
  • Create New...