![]() |
CSS Tricks
All you all might be knowing, CSS based pages are search-engine friendly, so we all try to implement CSS in our web pages, so here are a few CSS tricks which will help you work with ease.
CSS font shorthand rule When styling fonts with CSS you may be doing this: Code:
font-weight: bold;Code:
font: bold italic small-caps 1em/1.5em verdana,sans-serifTwo classes together Usually attributes are assigned just one class, but this doesn't mean that that's all you're allowed. In reality, you can assign as many classes as you like! For example: HTML Code:
<p class="text side">...CSS border default value When writing a border rule you'll usually specify the colour, width and style (in any order). For example, border: 3px solid #000 will give you a black solid border, 3px thick. However the only required value here is the border style. If you were to write just border: solid then the defaults for that border will be used. But what defaults? Well, the default width for a border is medium (equivalent to about 3 to 4px) and the default colour is that of the text colour within that border. If either of these are what you want for the border then you can leave them out of the CSS rule! CSS document for printing Lots of web pages have a link to a print-friendly version. What many of them don't realise is that there's no need because you can set up a second CSS document to be called up when a user prints the page. So, your page header should contains links to two CSS documents, one for the screen, and one for printing: HTML Code:
<link type="text/css" rel="stylesheet" href="stylesheet.css" media="screen" />So, what commands should you put in this second CSS document? To work it out, open a blank document and save it as printstyle.css. Next, point the screen CSS command to this document so that the command reads: HTML Code:
<link type="text/css" rel="stylesheet" href="printstyle.css" media="screen" /> |
Re: CSS Tricks
HI
nice read. I think you need some more points to add. Ok I have some. Quote:
|
Re: CSS Tricks
Two classes together
Usually attributes are assigned just one class, but this doesn't mean that that's all you're allowed. In reality, you can assign as many classes as you like! For example: <p class="text side">...</p> Using these two classes together (separated by a space, not with a comma) means that the paragraph calls up the rules assigned to both text and side. If any rules overlap between the two classes then the class which is below the other in the CSS document will take precedence. |
Re: CSS Tricks
CSS based pages are search-engine friendly, so we all try to implement CSS in our web pages thanks for the tricks!
|
Re: CSS Tricks
I have no brief knowledge so thanks for sharing the detailed information.
Thanks |
Re: CSS Tricks
CSS stands for Cascading Style Sheet and it is useful to add a style to a web document. CSS specifies a priority scheme to determine which style rules apply if more than one rule matches against a particular element. It is also easy to use and once CSS is ready then it will call for any new web design.
|
Re: CSS Tricks
Thanks pradeep for sharing this nice concepts on CSS
|
Re: CSS Tricks
In my point of view it is very harmful suggestion in this site.....Thanks for share useful information in here...:snore::snore::snore:
|
Re: CSS Tricks
The multiple classes and document printing tips were quite informative. I'm familiar with the basics of CSS and am looking to expand my knowledge. These tips are really good. Hope you post more tips like these! :)
|
| All times are GMT +5.5. The time now is 19:40. |