HTML/CSS question

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #19009
    Michael Brimer

    I’m reading a great book at the moment by Jon Duckett called HTML @ CSS -Design and Build Websites. He briefly mentions the <span> element on page 188 as a means of targeting a section of text when there is no other suitable element.

    My question is this. If for some reason I wanted to target a particular word (such as the word “and”) throughout the whole page, how could I go about doing this? If for some reason I wanted to change the general colour or appearance how could I go about doing this. I’m just wondering if the span element could somehow be used to create a class that could be applied to each occurrence of a specific word. Just wondering if you could provide an example covering the code in HTML/CSS.

    I’ve also reviewed your lessons Jamie including the video on CSS. I notice that when you create a new class you use that within a div element. Do you use a div to keep in line with the semantics of coding only as I’m pretty sure the same could be achieved using the p tag (although I am aware that p tags cannot be nested).



    Jamie Marsland

    Hi Mick,

    Yup the best way to target the same element multiple times is via a class so you’re on the right track :)


Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Scroll to Top