232k views
4 votes
Create styles to:Display the content of the page:

Limited to 90% of the window width.
Centered.
With a solid border 1 px wide colored black.
With 1 em of space between the border and all content. Warning: This includes the h1 heading.
With 1 em of space between the top border and the top of the page.
With 1 em of space between the bottom border and the bottom of the page. Their may be more if the browser window is tall enough or the content short enough.
Color the background of the header and footer elements to silver.
For the article elements:
Color the background to a color of your choice.
Display on the left at 70% of the content width. (This would be 70% of the 90%)
CSS external style sheet
-----------------------------------------
Set a minimum width of 350 px.
For the aside elements:
Color the background to a color that is a shade darker than the one for the article elements.
Display on the right at 30% of the content width. (This would be 30% of the 90%)
Set a minimum width of 150 px.
Each article and aside pair must display aligned vertically if the page is wide enough for them to be beside each other. (Display with the tops aligned.)
Display 1em of space between the header, each article/aside pair, and the footer.
The footer element must display below the second article and aside.
I used a float for my article and aside layouts but there are other (more complex) ways to do this with CSS.

User Anerdw
by
7.7k points

1 Answer

4 votes

Final answer:

The answer details CSS styling for creating a web page with constraints on content width, positioning of elements, and visual consistency. Styles are described for the main container, headers, footers, articles, and asides to ensure proper alignment and accessibility.

Step-by-step explanation:

To create styles that meet the specified requirements using CSS for a webpage, the following example provides the structure for meeting these formatting requirements:

  • The main container of the page is limited to 90% of the window width, centered and with a black border.
  • There is 1em of space between the border and the content, including the top and bottom.
  • The background for header and footer is set to silver.
  • Articles are displayed on the left at 70% of the container width, with a background color of your choice.
  • Asides are displayed on the right at 30% of the container width, with a darker shade for the background.
  • Minimum widths are set for articles and asides and they are aligned vertically if there's enough space.
  • Space is provided between the header, article/aside pairs, and footer.

These styles ensure a consistent visual style and accessibility for users, considering factors like color contrast and readability.

User Nasia Makrygianni
by
8.6k points