This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by Dyspareunia
about 10 years

What happened to stylesheet.css - Can I use two?

Hey all,

I noticed that all of a sudden in this tutorial we went from using:

<link rel='stylesheet' type='text/css' href='stylesheet.css'/>

to using:

<link rel='stylesheet' type='text/css' href='http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css'/>

I believe this contains the formatting needed for the accordion function. What if I want to use my own as well tho? Can I add two links to a css file and have them both be read?

Also, I noticed that the

<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>

and from the one out of the tutorial:

<script type='text/javascript' src='script.js'></script>

Is the 'type=' attribute not required? If so why use it at all?

Answer 5339d4e052f863451a00d7e1

0 votes

Permalink

Last question first… HTML5 presents with a couple of givens, which we can take as moot.

  1. type attribute - browsers have for a long time examined the document headers for MIME information to determine TYPE. The type attribute as a result is redundant. HTML5 lets us forego this attribute on all typical MIME types, namely CSS and JS.
  2. content attribute - again, browsers are quite able to detect HTML content, so we no longer need to use this attribute. In its place, HTML has introduced the <meta charset="UTF-8"> element.
  3. language attribute - this used to be declared in a meta tag, but now is only needed in the <html> opentag, as in,

OPENTAG with language attribute:

<html lang="EN-CA">

where EN is English, and CA is Canada. This refers to the document language, not system language (HTML is largely English), and refers to whatever is human readable in the page. We don’t see this attribute much in lesson code, but look around the web and you will see it used throughout the world. It is actually a crucial attribute as user agents go, though nowadays most of them can detect language without this attribute.

Next question: Can we add our own style sheet? Technically no, at least not in the same way as the ‘stylesheet.css’ is added. We would need to host it on a web server, then reference it the same was as the jQuery UI stylesheet is referenced, with an HTTP hook reference.

<link rel="stylesheet" href="http://www.__yourdomain.tld/cssuri.css">

Next question: The jQuery libraries are available from both Google Hosted Libraries and from the jQuery CDN, Either is fine. You can read more on their respective sites.

points
Submitted by Roy
about 10 years