Re: Global and Local Declarations

Giganews Newsgroups
Subject: Re: Global and Local Declarations
Posted by:  Thomas 'PointedEars' Lahn (PointedEa…
Date: Mon, 14 Aug 2017

Mike Copeland wrote:

> [unreadable]
>    Specifically, each page's code had a "body" statement (in the
> "style" section) that looked like this:


>  body { margin: 0 150px 0 150px; font: Verdana; font-size: 1.5em;
>          color: white; background-image: url("bg-green-grass.jpg"); }

That is a _rule(set)_ containing declarations; not a statement.  CSS is
_not_ a programming language.

There is no “‘style’ section”.  If you mean

  <style …>

that is a `style` _element_ (and an [X]HTML document can contain *several*
of them).

>    The first line is the code common to all pages, and the "color" and
> "background" vary.  I tried to make the 2nd part code-local (e.g.
>  .opt { color: white; background-image: url("bg-green-grass.jpg"); }
> and moved the 1st portion to my common .CSS file:
>  .global    { margin: 0 150px 0 150px; font: Verdana; font-size:
> 1.5em; }
>    Furthermore, I tried several CSS names (e.g. ".global, .body, body")
> with no success.

The first two are _class selectors_, the second one is an _element
selector_; not (just) “CSS names”.

> Of course, I used the page code like this:

There are no “Web pages”.

>  <body class="global opt">
>  <body class="body opt">

Hopefully only one of them at a time.

> Also without success...
>    Is there something about the "body tag" and its specification that
> prohibits my doing this?

No, and there is no “body tag”.

However, user settings/stylesheets and browser extensions/add-ons can
override/disable author stylesheets.

> Am I missing some fundamental CSS/HTML rule here?

That is likely as ISTM that you have not learned the basics yet.

> […] Please advise.  TIA>>>>>

> ---
> This email has been checked for viruses by [spam] software. […]

This is not e-mail.  Please disable this at least for posting to Usenet.


Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
  -- from> (404-comp.)



In response to

Global and Local Declarations posted by Mike Copeland on Mon, 31 Jul 2017