Page 2 of 4 FirstFirst 1 2 3 4 LastLast
Results 16 to 30 of 46

Thread: Xhtml css School

  1. #16
    Registered User Nobber708's Avatar
    Join Date
    Dec 2007
    Location
    Sweden
    Age
    32
    Posts
    1,549
    this shit became hard... could you add me on msn?
    It would be easier to ask there =p

    and one thing... When i press "test code" I see it as it should be
    But when I copy the code and paste it in to np++ it doesnt look the same =S
    Jiggitup
    .69.

    old lol?
    Hidden Text click here to show

  2. #17
    Administrator Cen's Avatar
    Join Date
    Sep 2006
    Location
    Slovenia
    Age
    32
    Posts
    15,685
    Blog Entries
    2
    Arba, I hope you didn't want to explain whole css attributes. Just
    explain the most basic ones and then add a list of those most
    usefull, because once you know the basics of styles, adding new
    attributes is very intuitive.

    I would like to sum-up the most basic stuff about css styles.

    1. Unless you are planning to do lots of pages that need the
    same style pattern (same titles, text color and font etc), the
    most usefull way is to declare all styles as the first thing inside the body.

    Here is a simple example.
    <style type="text/css">
    table { border:0px; text-align: center; }
    body { font-family: arial; font-size: 14px; background-color: black; color: #FFFFFF; }
    div.bold { font-weight: bold; }
    div.italic { font-style: italic; }
    div.gold { color: #FFE600; }
    a { color: #B400D8; text-decoration: underline }
    a:hover { color: #999999; }
    td.odd { border-top: 3px solid #E6E6E6; border-left: 3px solid #E6E6E6; border-right: 3px solid #E6E6E6; }
    td.even { border-bottom: 3px solid #E6E6E6; border-left: 3px solid #E6E6E6; border-top: 1px dotted #E6E6E6; border-right: 3px solid #E6E6E6;}
    td.topright { border-top: 3px solid #E6E6E6; border-right: 3px solid #E6E6E6;}
    td.right { border-right: 3px solid #E6E6E6; }
    td.top { border-top: 3px solid #E6E6E6; }
    </style>
    It's very simple actually. If you want to use some styles on a html element (body, p, h1, div, table, whatever),
    you simply declare it inside the styles area and tell what attributes should it have.

    Ex: You want all titles to be red, you simply add
    h1 { color: red }
    The color attribute will apply for ALL titles on your page.

    Now, if you want one title to be blue, you can do it in several ways.

    1. If there is only 1 blue title on the whole page, the easiest way to do it is,
    to put the style inside that title tag.
    Ex:
    <h1 style="color: blue">Blue title</h1>
    2. If there will be 1 blue title, or if you need it frequently (usually in scripts)
    you can add a new class style.
    ex:
    h1.blue { color: blue }
    And now you don't have to specify the style inside the h1 tag, but you just call that specific class.
    <h1 class="blue">Blue title</h1>

    If you need several colors OR any other text decoration/style (font, size, decoration, bold, italic etc) you simply create a new class with wanted attributes.

    3. If you want to change the style of title/text/table or whatever other element and you need to do it only few times (like: some words in bold etc)
    you simply create different classes for <span> or <div> tags. Because span and div can be wrapped around other elements and can change their style this way.
    ex: you have a text and need one word in bold.
    I don't think declaring who is black/white from my side is any better than the current system, since I would use random script to determine that, which is practically the same thing as inside the map.
    How to make that single word different (bold or whatever)?
    You simply declare new div/span class
    span.bold { font-weight: bold }
    And then simply
    I don't think declaring who is <span class="bold">black</span>/white from my side is any better than the current system, since I would use random script to determine that, which is practically the same thing as inside the map.
    You can also use DIV tag instead, the differene is, that DIV will take the whole row as it's own, but span will only affect it's content.
    Div is basically just like <span>something</span><br />.

    --------------------------------------------------------
    If you need some other attribute, like underline, special link styles ot something
    else, and you don't know how the attrbute is called (is it font-size or text-size? is it font-weight or font-decoration for bold? or none of these?) just google it! Ex: CSS bold, CSS alignment etc.. you will get the proper code asap. You really don't need to learn everything by your mind, it will come by itself.

    Also, if you are using some tools to help you with the code, those tools will
    automatically suggest you the attributes (ex: you type font- and the editor
    will suggest you the list of all existing styles with that text. I am using dreamweaver atm). Very usefull and can even give you some ideas.

    Undefeated Mad Balls Arena champion

  3. #18
    the roXor <3 Arbalest's Avatar
    Join Date
    Jan 2008
    Location
    above
    Age
    37
    Posts
    1,015
    Quote Originally Posted by Nobber708 View Post
    this shit became hard... could you add me on msn?
    It would be easier to ask there =p

    and one thing... When i press "test code" I see it as it should be
    But when I copy the code and paste it in to np++ it doesnt look the same =S
    well i made few spaces inside the quoted code ,so you'll have to write the codes yourself,try to read and understand and u'll find it's easy,and at sometimes i skip the page code to the part we are interested, if you wanna see it all just you your press "test code" right click on page and click "view page sourse" and it should be fine, but again i advise you at least to start alone and later you can fix what u did wrong otherwise u'll come out empty handed
    Quote Originally Posted by Cen View Post
    Arba, I hope you didn't want to explain whole css attributes. Just
    explain the most basic ones and then add a list of those most
    usefull, because once you know the basics of styles, adding new
    attributes is very intuitive.
    well nice work ,still what i was planning to do what guided lessons all what i was presenting was leading to a final TD,normaly what i was presenting the reader would use to the td which would have been a designed index page with menu links to some others page (normaly the page he did in the lessons before the td) .
    and i was not going to show all css properties ,just basic of css and css2.
    and beside as u saw it's for beginners if i would have wrote just theory they wouldn't understand ,anyway it's up to you after all.

  4. #19
    Administrator Cen's Avatar
    Join Date
    Sep 2006
    Location
    Slovenia
    Age
    32
    Posts
    15,685
    Blog Entries
    2
    Ok, about the second quizz, send me the questions when you have them.

    Undefeated Mad Balls Arena champion

  5. #20
    Administrator Cen's Avatar
    Join Date
    Sep 2006
    Location
    Slovenia
    Age
    32
    Posts
    15,685
    Blog Entries
    2
    Quizz for CSS 1/2
    [url]http://cenarius.hostzi.com/test6.php[/url]

    Undefeated Mad Balls Arena champion

  6. #21
    Registered User Stormhunter's Avatar
    Join Date
    Aug 2009
    Location
    Hercegovina
    Age
    36
    Posts
    174
    Thanks alot Arbalest very nice thread you put alot of effort in it
    gonna study all this next semester so i will be reading alot of this stuff
    Can you recommend some programs that you use for this


  7. #22
    the roXor <3 Arbalest's Avatar
    Join Date
    Jan 2008
    Location
    above
    Age
    37
    Posts
    1,015
    Quote Originally Posted by Stormhunter View Post
    Thanks alot Arbalest very nice thread you put alot of effort in it
    gonna study all this next semester so i will be reading alot of this stuff
    Can you recommend some programs that you use for this

    thx man , about the recommendation there is nothing special, almost everything u gonna need is already within the tutoriel, just read it and hf

  8. #23
    the roXor <3 Arbalest's Avatar
    Join Date
    Jan 2008
    Location
    above
    Age
    37
    Posts
    1,015

    Formatting text with CSS (Part 1/2)

    welcome to the second part of the 2 chapters dedicated text formatting
    The CSS you still reserve many surprises, so
    do not wait: go for it!


    There are a number of CSS properties as surprising sympathetic can give a little more style to your web pages (and I think it will not be refused)
    These range from bold, italic, underlined the development capital, through the ability to flash the text!

    Italicize

    I thought the tag <em> allowed to text in italics?!
    I never said that
    Head back to previous chapters if you have any doubts, but I never said that the tag <em> was made to put the text in italics (and I never said that <strong> was done to fat).

    <em>, get it well in the head is done to emphasize words. It means that the words surrounding it are very important.
    To represent this importance, most browsers put the text in italics (and not an obligation).

    If we can put in italics in CSS, so it's useful just for presentation. Because, I remind you, CSS is only for submitting your web pages.

    Specifically, to italicize using CSS font-style, which can take 3 values:
    • italic, the text will be italic.
    • oblique: the text will be italic. What again? Uh, to tell you I do not know myself, but all I see is that "italic" and "oblique" return to the same. So choose one of two
    • normal: The text will be normal (default). This allows you to cancel italics. For example, if you want the text between <em> no longer be in italics, you write:


    css code :
    em
    {
    font-style: normal;
    }
    In the following example I am using eg font-style to italicize all my titles <h2>:

    css code :

    h1
    {
    text-align: center;
    font-family: Arial, "Times New Roman", Verdana, serif;
    }
    h2
    {
    font-style: italic; /* Les titres h2 seront en italique ! */
    text-indent: 30px; /* On décale un peu les sous-titres */
    font-family: Arial, "Times New Roman", "Arial Black", Verdana, serif;
    }
    [URL="http://tutoriliez.eb2a.com/test%207.html"]test code[/URL]


    In short, it's easy to use, do not bother to hang longer on it

    Bold
    And if we were to put in bold?
    While there, same for <strong>, I do not redo the same speech that just now. The bolding in CSS enables the emboldening of such securities, some whole paragraphs etc. ... It's up to you.

    The CSS property to bold font-weight is, and take the following values:
    • bold: text will be bolded.
    • normal: the text is written normally (default).


    let's give a try to make a paragraph in bold:

    css code:

    p
    {
    font-weight: bold;
    }
    [URL="http://tutoriliez.eb2a.com/test%208.html"]test code[/URL]

    Capitalization CSS

    The CSS lets you apply effects very interesting text, changing automatically capitalized.
    We will see 2 CSS properties on the working capital.

    Start with the property font-variant, simple, taking only 2 different values:
    • Small-caps : the text is written in small capitals.
    • normal : the text is written normally (default).


    css code :
    p
    {
    font-variant: small-caps;
    }
    You write your paragraphs normally (as usual), and you let CSS take care of converting it for you automatically in small capitals. Is not it beautiful?

    But wait, there is a second CSS that works on uppercase also: text-transform. It can take these values:
    • uppercase : all text is written in capital letters.
    • lowercase : all text is in lowercase.
    • capitalize :The first letter of each word is capitalized.
    • none: no conversion (default).

    allright, it's time for an example I'll put the code that goes with XHTML:

    xhtml code :
    <h1> I am very angry ...</ h1>

    <p> ... but I'll try to stay calm. Finally, if possible, but I promise anything eh ... <br />
    <span class="wp"> ahhhh! not this time I crack! that it has put the mayo on my fries!? <br /> sacrilege! </ span> </ p>
    <p class="whisper"> THIS IS A PARAGRAPH THAT I WHISPER WHILE YET IN THE CODE XHTML IT IS WRITTEN IN CAPITAL LETTERS </ p>
    css code :
    h1
    {
    text-align: center;
    font-family: Arial, "Times New Roman", Verdana, serif;
    text-transform: capitalize; /* Les premières lettres des mots du titre seront en majuscules */
    }
    .wp
    {
    text-transform: uppercase; /* Si j'ai envie de me faire entendre, je mets en majuscules */
    }
    .whisper
    {
    text-transform: lowercase;
    font-style: italic; /* Le texte chuchoté sera en minuscules et italique */
    }
    [URL="http://tutoriliez.eb2a.com/test9.html"]test code[/URL]
    This text-transform property is very handy for changing the appearance of any text in a wink!

    Like anything, CSS is not just good to align the text and change the font. It can also act directly on a text already written to alter its capitalization.

    text decoration :
    This CSS property is aptly named: text-decoration
    It allows, among others, highlight the text. Here are the values it can take:
    • underline: stressed.
    • line-through: strikeout.
    • overline: line above.
    • Blink: Blinking. Warning, this property does not work with Internet Explorer or under Google Chrome. It works well in contrast to all other browsers, including Mozilla Firefox.
    • none: Normal (default).


    The CSS code allows you to test the effects of text-decoration:

    h1
    {
    text-align: center;
    font-family: "Arial Black", Arial, "Times New Roman", serif;
    text-decoration: blink; /* Le titre sera clignotant ! (ne fonctionne pas sous Internet Explorer) */
    }
    .stressed
    {
    text-decoration: underline;
    }
    .strikeout
    {
    text-decoration: line-through;
    }
    .line_above
    {
    text-decoration: overline;
    }
    xhtml code :
    <h1> Not to be missed </ h1>

    <p> <em> CSS property text-decoration </em> will just decorate the text: <br />
    <span class="stressed"> by underlining </span >...< br />
    <span class="strikeout"> in the blocking </span >...< br />
    ... or <span class="line_above"> by putting a line above </span>. </p>
    [URL="http://tutoriliez.eb2a.com/test10.html"]test code[/URL]

    Now to the vast topic of colors:
    vast? Oo how come?

    ell we have several opportunities to show color, as was the case with the text size.
    Here we see what are all these opportunities in the CSS to choose a color.

    First thing to know: the property that can change the text color is color (easy to remember), you have also glimpsed in the introduction to CSS.

    Enter the name of the color
    he most simple and most convenient to choose a color is to type its name (in English, of course).
    The only problem with this method is that there are only 16 colors called "standard". Other colors are unofficial, but as they do not necessarily work the same on all browsers, I'll avoid you show them.

    Here are the 16 colors you can use simply by typing their name:

    css code :


    h1
    {
    text-align: center;
    font-family: Arial, "Arial Black", "Times New Roman", serif;
    text-decoration: underline;
    color: green; /* Le titre en vert (pourquoi pas ?) */
    }
    p
    {
    text-indent: 20px;
    color: blue; /* Les paragraphes en bleu */
    }
    strong /* ... et les mots importants en rouge clignotant ! */
    {
    color: red;
    text-decoration: blink;
    }
    xhtml code :

    <h1> Of all the colors </h1>

    <p> Hi and welcome to this page colorful! I use <strong> standard color names </ strong> in my CSS to brighten up the page. Thus, "red" means "red", "blue" means "blue" and so on. </ P>

    <p> Through <em> color </em> CSS, I (among others) could automatically convert <strong> </ strong> all my important words (in a tag "strong") in flashing red text! That way, you will not miss the o) </ p>
    [URL="http://tutoriliez.eb2a.com/test11.html"]test code[/URL]

    The important texts in red blinking ... wp! imagination rulz .

    Hexadecimal notation :

    16 colors, it's still a bit limited when you consider that most monitors can display 16 million.
    On another side note, if he had to give a name to each of the 16 million color ...

    Fortunately, there are several ways in CSS to choose a color from all existing ones. First I'll show you is the hexadecimal notation.
    I will not go over because it is not convenient to handle, but it is still often used routinely. Indeed, before the CSS appears, was a common way to define a color (actually it was the only one: p).
    Luckily since it was invented simpler methods.

    A color name hex, it looks like this: # FF5A28. Simply put, it's a combination of letters and numbers that indicate a color.
    We must always start by writing a pound (#), followed by 6 letters or numbers from 0 to 9 and A to F.
    These letters or numbers work in pairs. The first 2 indicates a quantity of red, the 2 following amounts of green, and the last 2 a quantity of blue. By mixing these quantities (which are the components of Red-Green-Blue color) you can get the color you want.

    So #000000 is the color black and #FFFFFF for white. But now, ask me what is the combination that produces the color orange "sunset", I absolutely got no idea xD

    la method RGB

    Red-Green-Blue, which are abbreviated to "RGB". As for the hexadecimal notation, one can define an amount of red, green and blue to choose a color.
    there you'll see that it's much more convenient and with a drawing program simple as Paint, you can find the color you want .here how it's gonna be :
    [list=1][*]Start the Paint program from the Start menu.(start=>all programs=>accessories=>paint.[*]Go to the Colors menu / edit Colors
    [*]then press define custom colorsin the area that appears to the right, moves the cursor to select the color you want.[*]There are quantities of Red-Green-Blue corresponding indicated at the bottom right of the window (here 87-19-117). I copied these values in this order in the CSS file, like this:

    css code :
    h1
    {
    text-align: center;
    color: rgb(87-19-117);
    }
    Wp job done.

    As you can see from the example, to use the method you need to type RGB (Red, Green, Blue) by replacing "Red, Green, Blue" by the corresponding numbers.
    For your information, these numbers range from 0 to 255. If you write one day a quantity of red 327, mean that's wrong

    And Bonus Track ...
    I put to you a very simple program, which specializes in choosing a color. No doubt it will be very useful to help you choose your couleurs.Ce software called "la boite a couleur" (mean colors), made with C :developped by some ppl i know (not me )


    Contrary to what one might believe, the substance does not necessarily refer to the bottom of a webpage. You can also apply a background only to securities, or paragraphs, or certain words in a paragraph.

    It must first know that there are 2 types of funds:
    • The funds comprising a color
    • Funds with a background image

    We will begin our attention to the background color at first, then we will see how to have a background image.
    The background color :
    To specify a background color, use the CSS background-color. She used the same way as the color property, that is to say that you can type the name of a color, write in hexadecimal notation or use the RGB method.

    To specify the background color of the webpage, you have to work on the <body>. Yes, <body> is any web page, so it is changing its background color that you change the background color of the webpage.
    check the css code for it :
    body /* It works on the body tag, so the entire page */
    {
    background-color: black; /* The bottom of the page will be black */
    color: white; /* The text of the page is blank */
    }
    [URL="http://tutoriliez.eb2a.com/test12.html"]test code[/URL]

    Hey, but you said a text color white to the <body>, and all paragraphs and titles <p> <h1> took this color. How come?
    I just wanted to take this opportunity to speak. This phenomenon is called inheritance. No no, do not worry, there were no deaths

    In CSS, if you apply a style to a tag, all tags that are inside this tag will take the same style.
    cool hein?
    It's actually simple to understand and intuitive. The <body>, you know, contains among others the paragraph tags and title <p> <h1>.

    Applying a background color black and white text color to the <body> all my titles and paragraphs will also have a background color black and white text ... This phenomenon is called the inheritance is said that the tags that are inside another tag "inherit" its properties.
    does This means that ALL the text of my webpage will necessarily written in white?
    Not necessarily. If you say later that you want your titles in red, this style will take precedence and your shares will therefore be in red. However, if you do anything special (as was done earlier), then your shares will inherit the color white.
    This does not work only in color, hear us well. All CSS properties are inherited: for instance you can request a text size of "1.3em" in the <body>, and all your titles and paragraphs will be of that size.

    Here is an example where I show you how to "cancel" the legacy for which our securities are not written in white. I took the opportunity to create a class "highlights" which puts the text on a yellow background to give an impression of highlighting.
    body
    {
    background-color: black;
    color: white; /* All the tags in their body text will be colored in white ... */
    }
    h1
    {
    color: red; /* ... unless I specifically request to change the color result */
    }
    .highlights: /* A style that allows for example to highlight certain words in a text */
    {
    background-color: yellow;
    color: black; /* The highlighted text is written in black, because white on yellow background we see nothing o) */
    }
    [URL="http://tutoriliez.eb2a.com/test13.html"]test code[/URL]

    As you can see, we did not include a specific color for paragraphs (<p>), so they have inherited from the white. However, the title does not inherit the color white because it says they wanted it in red.
    The class "highlights" shows that you can safely apply a background color for certain words in a text. And the effect is quite nice not, cool hein? xD
    The background image :

    Like the background color, background image does not necessarily apply to the entire page, it might as well put a background image for title, paragraphs, quotes etc ...

    The property to specify a background image is background-image. As value, he should be put url( "name_of_the_image.png"). For example:
    background-image: url( "bottom.png");
    Of course, your background is not necessarily in PNG, it may also be in JPEG or GIF.
    The address indicating where the background image can be absolute (http:// ...) or relative (bottom.png).

    Be careful when you put an address on file in the CSS! The image address should be indicated against the file. Css and not from the file. Html.
    Thus, if your site has 2 folders: "css" and "images", you must type: ".. / images / fond.png" to get the background image. If you do not put the correct path, your background image will not appear.


    If you want to apply a background image to any page, you must again use the <body>:
    body
    {
    background-image: url("../images/snow.png");
    }
    h1
    {
    font-style: italic;
    font-family: "Arial Black", Arial, Verdana, serif;
    text-align: center;
    }
    blockquote p /* all the paragraphs within the blockquotes */
    {
    text-align: justify;
    text-indent: 25px;
    }
    There is also a CSS property that can "fix" the background, it does not move along with the text. The effect is, I find interesting.
    The property in question meets the sweet name of background-attachment and can take 2 values:
    • fixed: the background image remains fixed.
    • scroll: the background image scrolls with the text (default).



    There are still 2 properties in connection with background images that I want to show you.
    The first of these is that which manages the repetition of the background image. This property is called background-repeat and can take these values:
    • No-repeat: background will not be repeated. The image will be unique on the page.
    • repeat-x: Substance will be repeated only on the first row, horizontally.
    • repeat-y: Substance will be repeated only on the first column, vertically.
    • repeat: the fund will be repeated (by default).

    Let us still our same XHTML file, but this time apply a gradient background that is repeated vertically only.
    body
    {
    background-image: url("../images/degrade.png");
    background-repeat: repeat-y; /* The bottom will not be repeated on the first column, vertically */
    }
    h1
    {
    font-style: italic;
    font-family: "Arial Black", Arial, Verdana, serif;
    text-align: center;
    }
    blockquote p
    {
    text-align: justify;
    text-indent: 25px;
    }
    Finally, the last properties on the bottom that I wanted to show you (so they will all views) on the position of the background image.
    You can indicate which should be the background image with background-position. This property is interesting that if you put "background-repeat: no-repeat;" (a fund that is not repeated).

    You must give background-position 2 values in pixels to indicate the position of the bottom compared to top left corner of the page (or paragraph if you apply the background to a paragraph). So if you type:
    background-position: 30px 50px;
    ... Your background will be placed 30 pixels from the left and 50 pixels high. It is also possible to put these values into English:
    • top: the top.
    • bottom: bottom.
    • left: left.
    • Center:center
    • right: right.

    It is possible to combine these words. For example, to align an image in the top right, you would type: background-position: top right;

    Go to the last example I'll reuse all the properties on the merits we have learned

    css code:

    body
    {
    background-image: url("../images/skieur.gif"); /* the bottom image is "skieur.gif" */
    background-repeat: no-repeat; /* bottom won't be repeated */
    background-position: top right; /* The bottom line is at the top right */
    background-attachment: fixed; /* fix bottom */
    }
    h1
    {
    font-style: italic;
    font-family: "Arial Black", Arial, Verdana, serif;
    text-align: center;
    }
    blockquote p
    {
    text-align: justify;
    text-indent: 25px;
    }
    [URL="http://tutoriliez.eb2a.com/test14.html"]test code[/URL]

    If you use a lot of properties in connection with the background (as in this example), you can use a kind of "mega-property" background that can take several values combined properties background-image background-repeat , background-attachment and background-position.
    This is the first "mega-property" that I watch, there will be others. For all the "mega-properties" as background, he should know that:
    The order of values is not important. You can combine values in any order:
    • background: url ("../ images / skieur.gif ") no-repeat top right fixed;
    • background: no-repeat fixed top right url ("../ images / skieur.gif ");

    You do not have to put all the values. So if you do not get fixed, you can remove it without problem:
    background: url ("../ images / skieur.gif ") no-repeat top right;

    css code:
    body
    {
    background: url("../images/skieur.gif") no-repeat top right fixed;
    }
    h1
    {
    font-style: italic;
    font-family: "Arial Black", Arial, Verdana, serif;
    text-align: center;
    }
    blockquote p
    {
    text-align: justify;
    text-indent: 25px;
    }
    One last thing: in all these examples, I applied a background to the whole page (body). But this should not forget that you can apply a background to any element (title, paragraph, some words in a paragraph etc.) ...
    I advise you to train yourself to try to apply a background to your titles or paragraphs. If you have a little taste (which I did not) you will certainly give a beautiful look to your webpage.

    wp, job done that's it for today thx for reading and have a nice day.
    Last edited by Arbalest; 7th March 2010 at 01:52 PM.

  9. #24
    the roXor <3 Arbalest's Avatar
    Join Date
    Jan 2008
    Location
    above
    Age
    37
    Posts
    1,015

    css : Pseudo-formats

    Introduction :
    • we have reviewed a large number of CSS properties in previous chapters. Now you change the size of the text, its font, color etc etc ...
    • We show in this chapter a new aspect of language called CSS ...

    • We will not learn new CSS properties (you already know a lot), we rather see how they apply to times or locations. For example, we learn to change the appearance of a link to the mousing, to automatically change the first letter of a paragraph etc. ...

    All these factors should allow you to add more dynamism to your website. That's what's good for you

    standard links :
    If you followed the previous chapters, you know how to change the appearance of links. Simply apply styles to the tag <a> and voila.

    By default, links appear blue and underlined. Suppose you do not want to underline, you will use:

    text-decoration: none;

    ... This will negate the underscore. Your links will no longer be highlighted.

    simple and logic ^^

    let's make a small revision to heat a little, then we move on to serious. Here is a CSS styles applied to links 2-3 to change the filthy blue underlined links

    css code:
    a
    {
    text-decoration: none; /* links wwon't be underlined */
    color: red; /* The links in red instead of blue */
    font-style: italic; /* The links in italics (i just wanted that :P ) */
    }
    [URL="http://tutoriliez.eb2a.com/test15.html"]test code[/URL]
    in this lessson We will learn to change the look of links:
    • when the visitor points the mouse-over.
    • when the visitor clicks.
    • when the visitor selects a link.
    • when the visitor has already seen the page.


    The first pseudo-format I'll show you is: hover. Like all the other pseudo-formats that we will see, this is information that is added after the tag name (or class) in the CSS, like this:
    a:hover
    {

    }
    "hover" means "top ".
    "a:hover" therefore means: "When the mouse is on" (when pointing to it).
    On the left, type as usual the tag (in this case <a>, the link tag), and you put the right pseudo-format.
    right from here it's up to you to define the look that must have links pointing to it use your imagination, there is no limit ^^
    Here is an example of the links, but feel free to invent your own:
    a
    {
    text-decoration: none; /* Links are no longer highlighted */
    color: red /* The links in red instead of blue */
    font-style: italic; /* The links in italics (why not?) */
    }
    a:hover /* When the visitor points to the link */
    {
    text-decoration: underline; /* The link will become underlined when you point to it */
    color: green; /* The link is written in green when you point to it */
    }
    [URL="http://tutoriliez.eb2a.com/test16.html"]test code[/URL]

    cool isn't it ?
    The good news is that you can apply the pseudo-format ": hover" to any tag.
    The bad news is that Internet Explorer 6 on "hover" works only on links. In Internet Explorer 7, it works in theory on all the tags, but according to my tests there are still some bugs.

    On all other browsers (including Mozilla Firefox, google chrome, opera) it works perfectly.

    Here is an example of use :hover on a paragraph (test with another browser than IE):
    p:hover /* when pass the mouse over a paragraph */
    {
    background-color: #CFE1EB; /* the bottom of the paragraph change color */
    text-indent: 20px;
    }
    [URL="http://tutoriliez.eb2a.com/test17.html"]test code[/URL]

    If you point to the paragraphs, you see, then they change color. Not very useful, but after all the purpose of CSS is not to decorate isn't it?

    The pseudo-format: active permits to apply a particular style when you click. The link will keep this look very short time: just as you click the mouse. Clearly, this is not necessarily always visible.

    For my part, an effect that I found useful to apply with: active, change the background color of the link. That way, we can see that clicked :

    css code:
    a:active /* When the visitor clicks the link */
    {
    background-color: #FFCC66;
    }
    a:hover /* When the visitor points to the connection */
    {
    text-decoration: underline;
    color: green;
    }
    a /* Normal link */
    {
    text-decoration: none;
    color: red;
    font-style: italic;
    }
    [URL="http://tutoriliez.eb2a.com/test18.html"]test code[/URL]

    There is hardly different. The pseudo-format: focus style applied when the link is selected.

    which mean ?

    That is to say ... that it returns something like: active, ie at the time of the click (at least for a link).
    This pseudo-format used in other XHTML tags that we have not seen yet, will create very nice effects, you'll see

    so for now get it like this ,in links (:active and :focus) are alike, 2 twims if u wanna say so at this point,since both are alike i think we can do this

    a:active, a:focus /* Apply the same style on active and focus links */
    {
    background-color: #FFCC66;
    }

    It is possible to apply a style to a link to a page that has already been seen. By default, the browser link colors in purple foul (even more ugly than the underlined blue )

    Personally, I prefer to avoid changing the appearance of links that have already been seen because I think it's not very visually pleasing to the final. But again, it's a personal opinion, I do not want to influence you
    The pseudo-format that interests us is :visited which mean ...."visited" :P ), a funny application (but not very useful), this pseudo-format could be to block all connections have been seen ( which mean links barred line-through) :

    css code:
    a:visited /* When the visitor has already seen that page */
    {
    text-decoration: line-through;
    }
    a:focus /* When the visitor selects the link */
    {
    background-color: # FFCC66;
    }
    a:hover /* When the visitor points to the connection */
    {
    text-decoration: underline;
    color: green;
    }
    a /* Normal link */
    {
    text-decoration: none;
    color: red;
    font-style: italic;
    }
    [URL="http://tutoriliez.eb2a.com/test19.html"]test code[/URL]

    If you clicks on all links, they will be barred and you will not see much more,said captain obvious ^^

    Okay, if you want to apply a specific style for links already visited, I advise you to color links in slightly lighter than normal. If your links are normally green, turn the light green when they were visited.
    Finally, it is a suggestion as another, but it's an effect that's pretty good I think.

    wp i stop suggesting my ideas, if not all your web-sites will look alike xD
    Moreover, it has finished to see the pseudo-format typically used on links. We will now look to the pseudo-formats amending the first-letter or first-line.

    In CSS, you can automatically change the appearance of the first letter and first line of text within a tag.
    This is still pseudo-formats. If you tend to use those instead of paragraphs, remember that it also works well on other tags (like titles).
    p:first-letter /* The first letter of each paragraph */
    {
    font-weight: bold; /* Bold */
    font-size: 1.2em; /* Written slightly larger than normal */
    color: blue; /* In blue */
    }
    p
    {
    text-indent: 20px;
    }
    [URL="http://tutoriliez.eb2a.com/test20.html"]test code[/URL]

    First line :
    Another pseudo-interesting format to change this once the first line. These are: first-line.

    Applied to paragraphs, it can encourage the reading of the text. For example, you could automatically write in small caps in the first line of each paragraph, to make them more attractive:

    css code:
    p:first-line /* The first line of each paragraph */
    {
    font-variant: small-caps; /* In small caps */
    }
    p
    {
    text-indent: 20px;
    }
    [URL="http://tutoriliez.eb2a.com/test21.html"]test code[/URL]

    wp job done, with this last lesson we conclude the and we move on to the the power of the XHTML and CSS Combined
    from now on we're getting deep and getting to menu, forms index page design etc stay with us ^^ and have a nice day.
    Last edited by Arbalest; 8th March 2010 at 10:02 PM.

  10. #25
    Administrator Cen's Avatar
    Join Date
    Sep 2006
    Location
    Slovenia
    Age
    32
    Posts
    15,685
    Blog Entries
    2
    Well Arba, I didn't know you can add pseudo to every tag. Usefull stuff around here, ty.

    Undefeated Mad Balls Arena champion

  11. #26
    the roXor <3 Arbalest's Avatar
    Join Date
    Jan 2008
    Location
    above
    Age
    37
    Posts
    1,015
    Quote Originally Posted by Cen View Post
    Well Arba, I didn't know you can add pseudo to every tag. Usefull stuff around here, ty.
    thx man :] and wp u're welcome, btw it's some mighty sign u got there xDDD

  12. #27
    Administrator Cen's Avatar
    Join Date
    Sep 2006
    Location
    Slovenia
    Age
    32
    Posts
    15,685
    Blog Entries
    2
    Arba maybe you know. I have a small problem.

    THis works:
    <body background="../clwarback.jpg">
    But this doesn't:
    body { background-image: ../clwarback.jpg; }
    Any idea?

    Undefeated Mad Balls Arena champion

  13. #28
    the roXor <3 Arbalest's Avatar
    Join Date
    Jan 2008
    Location
    above
    Age
    37
    Posts
    1,015
    Quote Originally Posted by Cen View Post
    Arba maybe you know. I have a small problem.

    THis works:

    But this doesn't:

    Any idea?
    i think it's about the where u put the image and the where u put the xhtml page for example if the xhtml is at c:/ and the image is in (my documents) you gonna have to specify the exact position of the image starting from xhtml file , so in the image u add this path (C:\Documents and Settings\admin\My Documents) caus you the pc won't take it for granted ^^ or try to host the image (imageshak or ur own website and do it like this
    body
    {
    background-image:url('http://www.mysite.com/image.jpg');
    }
    if this doesn't work send me both files and i'll make my own tests and reply u the answers
    Last edited by Arbalest; 10th March 2010 at 09:16 PM.

  14. #29
    Administrator Cen's Avatar
    Join Date
    Sep 2006
    Location
    Slovenia
    Age
    32
    Posts
    15,685
    Blog Entries
    2
    ../ is a standard expression to start the path from site's root, so it should work

    will try direct linking anyway, maybe css can't read same way as html

    Undefeated Mad Balls Arena champion

  15. #30
    the roXor <3 Arbalest's Avatar
    Join Date
    Jan 2008
    Location
    above
    Age
    37
    Posts
    1,015
    Quote Originally Posted by Cen View Post
    ../ is a standard expression to start the path from site's root, so it should work

    will try direct linking anyway, maybe css can't read same way as html
    allright, btw u may consider code bug, at many times the html show something u didn't write , in this [URL="http://tutoriliez.eb2a.com/test13.html"]example[/URL]
    i didn't add code in css to make it barred still it happened, u can check the sourse code u'll see i didn't add a span tag on the barred words ,so i can add that fonction in css, by all means if it still the same i'm here to make some tests for u .

Page 2 of 4 FirstFirst 1 2 3 4 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Affiliates