Featured Post Today
print this page
Latest Post
Showing posts with label html-css. Show all posts
Showing posts with label html-css. Show all posts

CSS Property: text-decoration

Specifies whether text is underlined, over-lined or has a strikethrough.

Possible Values

  • inherit
  • none
  • underline
  • overline
  • line-through
  • blink - Not supported by IE. Note: blinking text is notoriously disliked by users and is bad from an accessibility point of view.


Example


a:hover { text-decoration: none; }
0 comments

How To Change Text Color Using HTML and CSS

Cascading Style Sheets (CSS) is the preferred method of changing text color, so first we will show the (archival) method of changing text color using inline HTML color codes, then we will move on to how to achieve the same effect using CSS.

Using Text Color (Hex) Codes

In order to change text colors, you will need two things:
1. A command to change the text.
2. A color (hex) code.
The color codes, as I mentioned above, are technically called hex codes. The codes are not very user friendly, so you'll need a chart to tell you what code makes what color. Well, I happen to have one right here: Click to go.
Drop by, grab a six-pack of color code, and come on back.


Old School: Changing Text Colors on the Whole Page

You have the ability to change full-page text colors over four levels:
<TEXT="######"> -- This denotes the full-page text color.

<LINK="######"> -- This denotes the color of the links on your page.

<ALINK="######"> -- This denotes the color the link will flash when clicked upon.

<VLINK="######"> -- This denotes the colors of the links after they have been visited.
These commands come right after the <TITLE> commands. Again, in that position they affect everything on the page. Also... place them all together inside the same command along with any background commands. Something like this:
< BODY BGCOLOR="######" TEXT="######" LINK="######" VLINK="######">

Please note: When you write these codes, you can write them with a # sign in front of the hex code or not. It used to be that the symbol was required, but not any more. I still use it just because I started that way. You may want to just go with the six-digit code. Also make sure to place a space between each command and be sure to enclose it in quotation marks, like so:
<VLINK="#FFFFFF">

Old School: Changing Specific Word Color

But I only want to change one word's color
!
You'll use a color (hex) code to do the trick. Follow this formula:
<FONT COLOR="######">text text text text text</FONT>
It's a pain in the you-know-where, but it gets the job done. It works with all H commands and text size commands. Basically, if it's text, it'll work.

Using Cascading Style Sheets (CSS) to Change Text Colors

A quick intro to CSS is in order, so let's describe it a bit. CSS is used to define different elements on your web page. These elements include text colors, link colors, page background, tables, forms--just about every aspect of the style of the web page. You can use CSS inline, much like the HTML above, or you can, more preferably, include theh style sheet within the HEAD tags on your page, as in this example:
<STYLE type=text/css>
A:link {
 COLOR: red /*The color of the link*/
}
A:visited {
 COLOR: #800080 /*The color of the visited link*/
}
A:hover {
 COLOR: green /*The color of the mouseover or 'hover' link*/
}
BODY { COLOR: #800080 /*The color of all the other text within the body of the page*/
{ 
</STYLE>
Alternately, you can include the CSS that is between the STYLE tags above, and save it in a file that you could call "basic.css" which would be placed in the root directory of your website. You would then refer to that style sheet by using a link that goes between the HEAD tags in your web page, like this:
<link type="text/css" rel="stylesheet" href="basic.css">
As you can see in the example above, you can refer to the colors using traditional color names, or hex codes as described above.
The use of CSS is vastly superior to using inline FONT tags and such, as it separates the content of your site from the style of your site, simplifying the process as you create more pages or change the style of elements. If you are using an external style sheet, you can make the change once in the style sheet, and it will be applied to your entire site. If you choose to include the style sheet itself within the HEAD tags as shown above, then you will have to make those changes on every page on your site.
CSS is such a useful tool in your web developer arsenal, you should definitely take the time to read more about it.
0 comments

20 Useful CSS Tips For Beginners

In the old days, we depend a lot of on developers and programmers to help update the website, even when it’s just a minor one. Thanks to the CSS and it’s flexibility, styles can be extract independently away from the codes. Now, with some basic understanding of CSS, even a novice can easily change the style of a website.
Whether you are interested in picking up CSS to create your own website, or merely to tweak your blog’s look and feel a little – it’s always good to start with the fundamentals to gain a stronger foundation. Let’s take a look at some CSS Tips we thought might be useful for beginners. Full list after jump.


  1. Use reset.css

    When it comes to rendering CSS styles, browsers like Firefox and Internet Explorer have different ways of handling them. reset.css resets all fundamental styles, so you starts with a real blank new stylesheets.
  2. Use Shorthand CSS

    Shorthand CSS gives you a shorter way of writing your CSS codes, and most important of all – it makes the code clearner and easier to understand.
    Instead of creating CSS like this
    1
    2
    3
    4
    5
    6
    .header {<br>
          background-color: #fff;<br>
          background-image: url(image.gif);<br>
          background-repeat: no-repeat;<br>
          background-position: top left; <br>
        }
    It can be short-handed into the following:
    1
    2
    3
    .header {<br>
          background: #fff url(image.gif) no-repeat top left<br>
        }
  3. Understanding Class and ID

    These two selectors often confuse beginners. In CSS, class is represented by a dot "." while id is a hash ‘#". In a nutshell id is used on style that is unique and don’t repeat itself, class on the other side, can be re-use.
  4. Power of <li>

    <li> a.k.a link list, is very useful when they are use correctly with <ol>or <ul>, particulary to style a navigation menu.
  5. Forget <table>, try <div>

    One of the greatest advantage of CSS is the use of <div> to achieve total flexibility in terms of styling. <div> are unlike <table>, where contents are ‘locked’ within a <td>‘s cell. It’s safe to say most <table> layouts are achievable with the use of <div> and proper styling, well maybe except massive tabular contents.
  6. CSS Debugging Tools

    It’s always good to get instant preview of the layout while tweaking the CSS, it helps understanding and debugging CSS styles better. Here are some free CSS debugging tools you can install on your browser: FireFox Web Developer, DOM Inspector, Internet Explorer Developer Toolbar, and Firebug.
  7. Avoid Superfluous Selectors

    Sometimes your CSS declaration can be simpler, meaning if you find yourself coding the following:
    • 1
      ul li { ... }
    • 1
      ol li { ... }
    • 1
      table tr td { ... }
    They can be shorten down to just
    • 1
      li { ... }
    • 1
      td { ... }
    Explanation: <li> will only exist within <ul> or <ol> and <td> will only be inside <tr> and <table> so there’s really not necessary to re-insert them.
  8. Knowing !important

    Any style marked with !important will be taken into use regardlessly if there’s a overwriting rule below it.
    1
    .page {<br> background-color:blue !important;<br>   background-color:red;<br>}
    In the example above, background-color:blue will be adapted because it’s marked with !important, even when there’s a background-color:red; below it. !important is used in situation where you want to force a style without something overwriting it, however it may not work in Internet Explorer.
  9. Replace Text with Image

    This is commonly practice to replace <h1>title</h1> from a text based title to an image. Here’s how you do it.
    1
    2
    3
    4
    5
    6
    h1 {<br>
    text-indent:-9999px;<br>
    background:url("title.jpg") no-repeat;<br>
    width:100px;<br>
    height:50px;<br>
    }
    Explanation: text-indent:-9999px; throws your text title off screen, replaced by an image declared by background: {...} with a fixed widthand height.
  10. Understand CSS Positioning

    The following article gives you a clear understanding in using CSS positioning – position: {...}
  11. CSS @import vs <link>

    There are 2 ways to call an external CSS file – respectively using @importand <link>. If you are uncertain which method to use, here’s few articles to help you decide.
  12. Designing Forms in CSS

    Web forms can be easily design and customize with CSS. These following articles show you how:

  13. Get Inspired

    If you are looking around for nicely designed CSS-based website for inspiration, or just simply browsing to find some good UI, here are some CSS showcase site we recommend:
  14. Rounded Corners in CSS

    This following article gives you an idea how to create cross-browser compatible rounded borders with CSS.
  15. Keep CSS Codes Clean

    If your CSS codes are messy, you are going to end up coding in confusion and having a hard time refereing the previous code. For starters, you can create proper indentation, comment them properly.
  16. Typography Measurement: px vs em

    Having problem choosing when to use measurement unit px or em? These following articles might give you a better understanding on the typography units.
  17. CSS Browsers Compatibility Table

    We all know each browser has different ways of rendering CSS styles. It’s good to have a reference, a chart or a list that shows the entire CSS compatibility for each browser.
    CSS support table: #1, #2, #3, #4.

  18. Design Multicolumns in CSS

    Having problem getting the left, middle and right column to align properly? Here are some articles that might help:

  19. Get a Free CSS Editors

    Dedicated editors are always better than a notepad. Here are some we recommend:

  20. Understanding Media Types

    There are few media types when you declare CSS with <link>. print, projection and screen are few of the commonly used types. Understanding and using them in proper ways allow better user accessibility. The following article explains how to deal with CSS Media types.
0 comments
 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Document Information - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger