www.webdeveloper.com
Results 1 to 4 of 4

Thread: Do I have to put <div style> and all its attributes.

  1. #1
    Join Date
    Apr 2012
    Posts
    110

    Do I have to put <div style> and all its attributes.

    Hi, do I have to put a <div style> in the html part, when I put a div class in the css ontop of the page. Cant I just put a name ontop as the class.
    Then put <div class="name"> or whatever in the html. For example.
    Put #image1 { and its properities and values in the Css ontop of page under the <head> tag and then put <div class="image1> in the <body>
    Is it aslo necessary to put <a href= > in the html, if I put the url in the Css ontop page.

  2. #2
    Join Date
    Mar 2012
    Posts
    48
    if you want <div class="image1> to be link to redirect users, than you should put a <a href=>
    in the #image1 you can define the background image of the div, not the redirection link..

  3. #3
    Join Date
    May 2005
    Location
    Gold Coast (MS)
    Posts
    2,199
    It is always best to have an external CSS file unless you only have one or two pages. Then use of embedded CSS probably would be easier for you if linking to an external CSS file is too much.

    Following should help you with CSS...

    Between the head tags of each page:
    Code:
    <link rel="stylesheet" type="text/css" href="css-file-name.css">
    CSS Tutorials:

    Twenty Advanced CSS Tutorials: http://designfestival.com/twenty-top...&utm_term=More
    Advanced CSS: http://www.yourhtmlsource.com/styles...vancedcss.html
    http://www.handycss.com/
    http://www.w3.org/Style/Examples/011/firstcss
    http://www.csstutorial.net/

    Dynamic Drive CSS Library: http://www.dynamicdrive.com/style/
    http://www.echoecho.com/css.htm
    http://htmldog.com/guides/cssbeginner/
    http://www.davesite.com/webstation/css/
    http://www.htmlcodetutorial.com/char...msupp_193.html

    http://www.w3schools.com/Css/default.asp
    LESS Is More: Make Your CSS Coding Easier with LESS: http://www.elated.com/articles/less-...ier-with-less/
    CSS Layout Generator: http://csscreator.com/version2/pagelayout.php

  4. #4
    Join Date
    Nov 2002
    Posts
    2,632
    Quote Originally Posted by wildguy2 View Post
    Hi, do I have to put a <div style> in the html part, when I put a div class in the css ontop of the page. Cant I just put a name ontop as the class.
    Then put <div class="name"> or whatever in the html. For example.
    Put #image1 { and its properities and values in the Css ontop of page under the <head> tag and then put <div class="image1> in the <body>
    Is it aslo necessary to put <a href= > in the html, if I put the url in the Css ontop page.
    If you use a class attribute:
    Code:
    <div class="name">
    Code:
    .name {
        //CSS
    }
    If you use an id attribute:
    Code:
    <div id="name">
    Code:
    #name {
        //CSS
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles