Topic: css background note Pages that link to <a href="https://ozoneasylum.com/backlink?for=26502" title="Pages that link to Topic: css background note" rel="nofollow" >Topic: css background note\

 
Author Thread
JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

IP logged posted posted 08-22-2005 04:52 Edit Quote

.top p {background:transparent url('bg.gif') no-repeat top right;}

and

.top p {background:transparent url('bg.gif')no-repeat top right;}

are nOT the same. The difference is the space between the url parenthesis and the repeat bit. An hour of tearing my hair out makes me pass this along. If you do it without the space using xhtml 1.0 strict, the background images will not show in IE 5, 5.6 or 6.

This has pretty much been a convention/habit of mine to leave no space there so this had me tearing my hear out for close to an hour.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

IP logged posted posted 08-22-2005 08:48 Edit Quote

Did you try the CSS validator? That might have caught it.


 

JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

IP logged posted posted 08-22-2005 09:34 Edit Quote

frankly, I normally just use the validator when I'm done to see how I did =\

I should put that button back on the link bar

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

IP logged posted posted 08-23-2005 03:37 Edit Quote

It might not have caught it, either. I'm not sure if it's invalid. =)

Tracking down IE bugs is a time consuming activity.


 

synax
Maniac (V) Inmate

From: Cell 666
Insane since: Mar 2002

IP logged posted posted 08-23-2005 18:51 Edit Quote

Yeah, making a habit of keeping your markup neat and clean will help you avoid these kinds of problems. This is where being anal about whitespace, indentation, brackets, semi colons, etc pays off.

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

IP logged posted posted 08-23-2005 19:03 Edit Quote

Of course being anal about it, and being correct about it don't always go hand in hand

I eliminate as much white space as possible from my CSS syntax, personally.
Always good to know where you can and can't cut the spaces...

JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

IP logged posted posted 08-23-2005 22:01 Edit Quote
code:
body {
	color : black;
	}



everybody post your css conventions^ if you would. Mine is odd I think, it doesn't match most people's, the space either side of the colon and the tab on the closing bracket seem to be unique to me, helps *me* to be able to scan a long stylesheet but tends to irritate anyone else that has to look through mine

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

IP logged posted posted 08-23-2005 23:31 Edit Quote

Nowadays I do this:

code:
body {
    color: black;
}



Not too long ago, though, I preferred this:

code:
body {
    color: black;
    }

Ensellitis
Bipolar (III) Inmate

From: Kansas City, MO , USA
Insane since: Feb 2002

IP logged posted posted 08-24-2005 00:02 Edit Quote

I usually do

code:
body {color: black;}


if I am only doing a few things, otherwise I do:

code:
body {
color: black;
}



zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

IP logged posted posted 08-24-2005 01:03 Edit Quote

If it's inline:

code:
body{ color:black; }


If it's internal/external:

code:
body{
color:black;
}


Usually my biggest mistakes aren't really incorrect syntax, usualy I just put things where I didn't want them, like giving paragraph tags the color I wanted for the header tags. Most of my problems are with PHP anyway, that's another story though.

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

IP logged posted posted 08-24-2005 03:56 Edit Quote
code:
body {
	 color:#000;
	 }

briggl
Bipolar (III) Inmate

From: New England
Insane since: Sep 2000

IP logged posted posted 08-24-2005 04:48 Edit Quote
code:
body {
     color: #000;
     }



(Edited by briggl on 08-24-2005 04:52)

JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

IP logged posted posted 08-24-2005 04:53 Edit Quote

very interesting

*rubs hands together* I'm going to have to find a way to bend the world to my style...

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

IP logged posted posted 08-24-2005 06:24 Edit Quote
code:
body
{
    color: #000;
}



If it's short like that sometimes I'll combine the opening bracket with the first line to keep from taking too much space, but otherwise I like having the opening and closing brackets in line like that for clarity.

JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

IP logged posted posted 08-24-2005 06:31 Edit Quote

selector space bracketopen bracketclose backarrow return tab return tab up arrow

ain't it funny how hard such simple habits are to break?!

briggl
Bipolar (III) Inmate

From: New England
Insane since: Sep 2000

IP logged posted posted 08-24-2005 07:11 Edit Quote
quote:
selector space bracketopen bracketclose backarrow return tab return tab up arrow


Exactly the way I do it!


JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

IP logged posted posted 08-24-2005 08:43 Edit Quote

creeeepy!

Blaise
Paranoid (IV) Inmate

From: London
Insane since: Jun 2003

IP logged posted posted 08-24-2005 12:43 Edit Quote

I'm the same as reisio's first example, it just seems to make sense as most of the time I'll apply more than one property to a selector, if they're all on one line then they're harder to read and edit.

selector space bracketopen bracketclose backarrow return return up arrow tab

Cheers,



(Edited by Blaise on 08-24-2005 12:44)

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

IP logged posted posted 08-24-2005 14:06 Edit Quote

Oops, my spacing didn't go through the right way - I set it up just like briggl has it. I tab over one tab for the brackets, so if the selector is longer than one tab length, I add a carriage return, so all of my brackets are always vertically aligned, along with the left edge of all the attributes.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu