![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
|
OK, here's a little CSS trick
so I really got tired of fixing some CSS sheets with HORRORS (they're not even errors), therefore here's a tip for you guys to save bandwidth, make spacing coherent and clear floats all at once while saving time.
First, for those that still don't know (the vast majority for what I see), you should do something at the top of every stylesheet: reset everything. I won't go further on that since there are gazillions of tutorials on it. So while you're resetting everything, add this: Code:
hr{clear:both; visibility:hidden; margin:10px 0;} /* modify the margin to whatever you want */ Now, every time you need some spacing or clear floats, instead of redefining or adding elements, simply add the <hr/> tag and that's it of course, in the event that you need a real <hr> simply define it like <hr class="whatever" />, but chances are 99 times out of 100 you won't need the hr tag. Hell, if I remember right the last time I used the hr tag was in 1998! Anyway, hope you like it ![]()
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2003
Posts: 22,651
|
nifty trick
![]() I do the same thing with a clear class like Code:
.clear {clear:both;} Code:
<div class="clear" style="height:xxpx;"></div> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Oct 2003
Location: Command Central, West Palm Beach, Fl
Posts: 1,794
|
I use the JD method, but I like the hr idea too.
__________________
I do stuff - aIm CS_Jay_D |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Confirmed User
Industry Role:
Join Date: Jan 2009
Posts: 420
|
Quote:
![]() ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
So Fucking Banned
Join Date: Apr 2007
Posts: 806
|
Quote:
1) for predictable cross-browser results call every variable at the beginning of the style sheet. ie: font-family font-size font-style line-height margin padding p margin p padding div margin div padding i margin i padding em margin em padding etc etc etc Just obey cascading for the best results. I keep all base (global) styling in a 'base' file to be read 1st. Then unique page/site styling in a unique CSS file to be read 2nd. ... ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Industry Role:
Join Date: Mar 2003
Location: San Diego
Posts: 32,174
|
guess what this does?
#index_table IMG:hover { BORDER-RIGHT: #f09 2px ridge; border-top: #f09 2px ridge; border-bottom: #f09 2px ridge; border-left: #f09 2px ridge; FLOAT: left; MARGIN: 0px 5px 0px 0px;
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
So Fucking Banned
Join Date: Apr 2007
Posts: 806
|
It doesn't do jack shit unless you have an element named index_table
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
I make pixels work
Industry Role:
Join Date: Jun 2005
Location: I live here...
Posts: 24,386
|
Quote:
StuartD invented CSS ![]()
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Programming King Pin
Industry Role:
Join Date: Oct 2003
Location: Montreal
Posts: 27,360
|
I like the simplicity of your HR trick! I should start using it
![]()
__________________
UUGallery Builder - automated photo/video gallery plugin for Wordpress! ![]() ![]() ![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Industry Role:
Join Date: Aug 2009
Location: Dallas, TX
Posts: 1,056
|
Thanks for sharing your tips. I am just learning how to do all the css stuff.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 | |||
Confirmed User
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
|
Quote:
![]() Quote:
![]() Quote:
yeah, but my thing is CZZ, which is only for l33t people ![]()
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth |
|||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
I make pixels work
Industry Role:
Join Date: Jun 2005
Location: I live here...
Posts: 24,386
|
O i sees - Well you mis titled then
![]() Keep up the good shit ![]()
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Guest
Posts: n/a
|
Code:
.clearFix:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; } .clearFix { display: inline-block; } /* start commented backslash hack \*/ * html .clearFix { height: 1%; } .clearFix { display: block; } /* close commented backslash hack */ *, html { margin: 0; } |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
I make pixels work
Industry Role:
Join Date: Jun 2005
Location: I live here...
Posts: 24,386
|
Code:
* {margin:0;padding:0;}
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Confirmed User
Join Date: May 2004
Location: SW Palm Bay, Florida
Posts: 1,323
|
__________________
subarus. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2003
Posts: 22,651
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |