Cascading Style Sheets in XHTML 1.0 STRICT

  • Context: HTML/CSS 
  • Thread starter Thread starter jeff1evesque
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the implementation of Cascading Style Sheets (CSS) in an XHTML 1.0 Strict document. Participants explore issues related to class naming, linking CSS files, and understanding specific attributes in the HTML link tag.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant describes their setup for a webpage and the CSS file intended to style it, including the use of a class named "body" to set background color and text properties.
  • Another participant suggests that naming the body tag is unnecessary since it is unique and proposes removing the class attribute and the period in the CSS file.
  • A later reply indicates that the suggested changes did not resolve the issue, but the participant is willing to experiment further.
  • One participant explains the meaning of the "rel" attribute in the link tag, stating it defines the relationship to the linked file, while "type" specifies the MIME type.
  • A final post expresses gratitude for the assistance and mentions finding a solution to the problems discussed.

Areas of Agreement / Disagreement

Participants express differing views on the necessity of using a class for the body tag, with some supporting its removal while others have not reached a consensus on the effectiveness of the proposed changes.

Contextual Notes

There are unresolved technical issues regarding the implementation of CSS and the specific attributes used in the link tag, as well as the effectiveness of the proposed solutions.

jeff1evesque
Messages
312
Reaction score
0
I am creating a webpage that is located on a server, where the parent directory is called public_html. In this directory, I have the file called assign5A.html that will be the web page seen on the browser. This file utilizes another file located in a subdirectory- public_html/CSS- and is called mystyles.css.

I am trying to create a class called "body" which will encapsulate the entire body of the page. I am going to try to set the background color along with the text font and color. So in the beginning of the assign5A.html I have written the following (notice it is written in XHTML 1.0 strict):

<?xml version = "1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>CS403 Spring 2009 Assignment 5</title>
<link type = "text/css" rel = "stylesheet" href = "CSS/mystyles.css" />
</head>

<body class = "body">
.
.
.
</body>
</html>


**This entire source code can be viewed at http://pubpages.unh.edu/~jmm42/assign5A.html**
-----------------------------------------------------

Now in the file public_html/CSS/mystyles.css, I have written the following to specify the necessary changes(and I changed the permission to -rw-r--r--):

<!-- File includes rules to add presentation details to assign5A.html -->

.body {background-color: #0000FF;}
-----------------------------------------------------

I'm pretty sure I was told that in the CSS file I had to put a period character before the class name, with brackets following containing attribute properties inside it. Oh yea, I never understood what type, rel stood for in the code <link type = "text/css" rel = "stylesheet" href = "CSS/mystyles.css" />
 
Last edited by a moderator:
Technology news on Phys.org
You don't need to name the body tag. It's already unique and only used once. So get rid of the class attribute and delete the period in front of it in the css file.
 
I tried it, doesn't seem to work. But I think you are correct, I'll play around with it.Thanks a lot,JL
 
"rel" is the relationship between the current (XHTML) file and the linked file. In this case, the file is a style sheet, so it is coded rel="stylesheet".

Type gives the MIME type. Other types: text/plain, text/html, application/xhtml+xml, application/octet-stream, image/jpeg, image/png, etc.
 
Thanks for the help guys. I found the solution to my problems.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
8K
  • · Replies 2 ·
Replies
2
Views
5K