CSD Unit 2 CSS multiple styles same page

I am just wrapping up Unit 2 . My students and I do not want all the pictures and text on our web pages aligned identically, but the unit is designed to have one CSS style page and is taught throughout with one style page We are able to make different style pages for different linked pages with no problem, but how can we identify different “like” elements on the page to have different attributes? For instance what if we want to place one pic on the left margin and one in the center. We have experimented with padding and margins, but it seems we do not know the correct placement within the style on index page. We also thought about establishing classes such as left pics or centered text. Can anyone help?

1 Like

Sounds like you’re looking for how to use “classes”, which allows you to “group” selected items on a page (specific images and/or paragraphs, links, etc) and assign attributes to just those items.

You can also assign attributes to individual items on the page, although that’s not taught in the curriculum (presumably not a high priority for most teachers/students).

Here’s how: https://www.w3schools.com/css/css_howto.asp (see “Inline Styles” near the bottom)

2 Likes