Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.sinclair > #4119

Re: The joy of DLAN (modern web devs please read)

From Calum <com.gmail@nospam.scottishwildcat>
Newsgroups comp.sys.sinclair
Subject Re: The joy of DLAN (modern web devs please read)
Date 2016-03-02 13:58 +0000
Organization Aioe.org NNTP Server
Message-ID <nb6rhv$c86$1@gioia.aioe.org> (permalink)
References <ce74b513-fa1e-4971-be03-f0743c4d833e@googlegroups.com> <nad8cc$kh2$1@gioia.aioe.org> <cb2d4882-36cb-4efe-bfc5-8257d6a3cd1a@googlegroups.com> <nas7um$19ph$1@gioia.aioe.org> <abb78c92-4cfd-493f-89c5-6529399f91ee@googlegroups.com>

Show all headers | View raw


On 02/03/2016 10:19, bit-naughty@hotmail.com wrote:
> On Saturday, February 27, 2016 at 6:52:33 PM UTC+5:30, Calum wrote:
>
>> If you're already comfortable with HTML, you can skip ahead a bit
>> to episode 6 or so.
>
> Thanks for your help.
>
> So - what exactly is a "class" then? 2 or more things on screen that
> will look the same, ie. for example, have the same font?
>
> And if there's say, a PHP program outputting a webpage, suppose
> there's 2 different sections of text on screen, and they will have
> different fonts etc., then what does it need to do? Will it have to
> fiddle with _classes_ or _id's_?? How?? (I find the whole thing
> slightly complicated to visualise inside my head....)

Caveat: I'm not a PHP guy :) But in general, the generated HTML should 
include a class or an id attribute for each element that you want to 
apply a specific style to.

Ideally the HTML should also specify a CSS file to apply to that page, 
and it's in that CSS file that you would define what each of those 
sections should look like. But depending on your requirements, you could 
define those the CSS styles directly in the <head> section of the 
generated HTML file instead. It's just usually nicer to keep the content 
(the HTML) and the presentation of that content (the CSS) separate, 
unless there's a good reason not to.

Classes and id's do the same job. They give a name of your choice to an 
HTML element so you can more easily refer to it elsewhere, e.g. to 
specify its initial visual appearance (e.g. using CSS), or manipulate it 
programmatically (e.g. using JavaScript) after the page has been 
rendered in the browser.

The only real difference between classes and ids is that the same id 
cannot be used more than once on a page, but multiple elements on the 
same page can have the same class name. So for example, you might use an 
id of 'copyright-message' for the copyright message that you put at the 
bottom of every page on your website, but you might use a class name of 
'image-with-border' for all the images on your page that you want to 
have the same fancy border.

Technically, that means id's are redundant and you don't *really* need 
to use them at all... you can always just use a class instead, and 
indeed, some web coding style guides recommend doing just that. But they 
can also be quite useful just to remind you (or other people reading 
your code) that 'I gave this thing an id, so it must be the only one of 
this thing on the page'.

Back to comp.sys.sinclair | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

The joy of DLAN (modern web devs please read) bit-naughty@hotmail.com - 2016-02-21 09:33 -0800
  Re: The joy of DLAN (modern web devs please read) Calum <com.gmail@nospam.scottishwildcat> - 2016-02-21 20:57 +0000
    Re: The joy of DLAN (modern web devs please read) "Brian Gaff" <briang1@blueyonder.co.uk> - 2016-02-22 11:04 +0000
      Re: The joy of DLAN (modern web devs please read) Calum <com.gmail@nospam.scottishwildcat> - 2016-02-22 12:00 +0000
    Re: The joy of DLAN (modern web devs please read) bit-naughty@hotmail.com - 2016-02-26 07:38 -0800
      Re: The joy of DLAN (modern web devs please read) Calum <com.gmail@nospam.scottishwildcat> - 2016-02-27 13:22 +0000
        Re: The joy of DLAN (modern web devs please read) bit-naughty@hotmail.com - 2016-03-02 02:19 -0800
          Re: The joy of DLAN (modern web devs please read) Calum <com.gmail@nospam.scottishwildcat> - 2016-03-02 13:58 +0000
            Re: The joy of DLAN (modern web devs please read) bit-naughty@hotmail.com - 2016-03-06 22:55 -0800
              Re: The joy of DLAN (modern web devs please read) Guesser <alistair@zxnet.co.uk> - 2016-03-07 10:25 +0000
                Re: The joy of DLAN (modern web devs please read) bit-naughty@hotmail.com - 2016-03-07 07:03 -0800
                Re: The joy of DLAN (modern web devs please read) Guesser <alistair@zxnet.co.uk> - 2016-03-07 15:33 +0000
                Re: The joy of DLAN (modern web devs please read) Calum <com.gmail@nospam.scottishwildcat> - 2016-03-07 17:37 +0000
              Re: The joy of DLAN (modern web devs please read) Calum <com.gmail@nospam.scottishwildcat> - 2016-03-07 18:41 +0000
                Re: The joy of DLAN (modern web devs please read) bit-naughty@hotmail.com - 2016-03-13 08:55 -0700
                Re: The joy of DLAN (modern web devs please read) Calum <com.gmail@nospam.scottishwildcat> - 2016-03-13 16:44 +0000
  Re: The joy of DLAN (modern web devs please read) "Brian Gaff" <briang1@blueyonder.co.uk> - 2016-02-22 11:01 +0000
    Re: The joy of DLAN (modern web devs please read) bit-naughty@hotmail.com - 2016-02-26 08:34 -0800
      Re: The joy of DLAN (modern web devs please read) "Brian Gaff" <briang1@blueyonder.co.uk> - 2016-02-28 11:04 +0000
        Re: The joy of DLAN (modern web devs please read) Calum <com.gmail@nospam.scottishwildcat> - 2016-02-28 11:34 +0000

csiph-web