Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

HTML and CSS Linking Question

html5 css linking web-development

Best Answer lespauled, 18 June 2015 - 11:07 AM

if you're talking about linking the CSS file for use in the html, 

<LINK REL=StyleSheet HREF="style.css" TYPE="text/css"/>

If not, you'll have to learn about selectors.  The easiest one to learn is the "type" selector:

h2 {
   ...
}

Then the class selector:

.myClassName {
....
}

and the id selector :

#myElementID {
...
}

There are other selectors, but first learn these and work yourself deeper into CSS.

Go to the full post


This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 Altru

Altru

    CC Lurker

  • New Member
  • Pip
  • 5 posts

Posted 18 June 2015 - 10:24 AM

At the time of this writing, I'd like to say good morning! I am curious about the process of linking an HTML document with a seperate CSS document. If i'm not mistaken, I understand that you can reference the CSS document with a specific html element and its accompanying attribute(s), of which, I am still in the process of learning (new to web-development). Any how, is it possible to link the CSS document without having to first host the files through a hosting service in order to live preview them? In other words, how can I view an HTML document with seperate CSS styling offline?



#2 lespauled

lespauled

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1360 posts

Posted 18 June 2015 - 11:07 AM   Best Answer

if you're talking about linking the CSS file for use in the html, 

<LINK REL=StyleSheet HREF="style.css" TYPE="text/css"/>

If not, you'll have to learn about selectors.  The easiest one to learn is the "type" selector:

h2 {
   ...
}

Then the class selector:

.myClassName {
....
}

and the id selector :

#myElementID {
...
}

There are other selectors, but first learn these and work yourself deeper into CSS.


My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download