Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS documents

Featured Replies

Hi all

 

Can you have a CSS document that is too long?

 

I'm doing a new site and the CSS seems to be neverending, is it ok if there are lots of lines?

 

Thanks

Kerstey

Why don't you have split it up into different secions:

 

navigation.css

contact.css

 

etc... for each main different bit of your site if that helps?

Exactly what he said.

 

I often use, and other people do too so I aren't that special, more than one CSS page. Like AdamConder says generalise them to what they belong to

 

navigation.css

heading.css

body.css

 

etc.

Like Adam said, split it up into seperate documents, I usually have the following:

 

main.css which has all of the main attributes of my document, so the major structural things, star selectors and so on and so forth.

formatting.css which is all of the formatting for text, anchors, images and stuff.

nav.css which is for the navigation, which can sometimes be quite complicated.

forms.css for any contact forms that I'm using.

 

The good thing is that you only have to link to one document in your html page, and use the import code on that one document:

 

<link rel="stylesheet" href="css/main.css" type="text/css" media="screen" />

 

So this is only linking to the 'main.css' document, but in that document you use the following code:

 

@import url('formatting.css');
@import url('nav.css');
@import url('forms.css');

 

Hope that helps.

 

If you want to take a look at my code, then you can head over to http://traxor-designs.com/css/ and have a look through my stylesheet documents. It's sometimes easier to have a first-hand view.

Edited by traxor

It probably doesn't matter to have a long css file as long as you actually need all the styles, just try to create spaces and /*COMMENTS IN CAPITALS*/ occasionally so that you can find your way around more easily later.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.