CSS Set a background color which is 50 of the width of the window

0 votes

Attempting to create a "split-in-two" background with two colors on either side of the page (seemingly done by setting a default background color on the body tag, then applying another onto a div that stretches the entire width of the window).

Unfortunately, despite my best efforts, the background-size attribute is inoperable in IE7 and IE8, which is essential for this project-

body { background: #fff; }
#wrapper {
    background: url(1px.png) repeat-y;
    background-size: 50% auto;
    width: 100%;
}

Since it's just about solid colors maybe there is a way using only the regular background-color property?

Jun 27 in CSS by Edureka
• 9,800 points
41 views

1 answer to this question.

0 votes

You can make a hard distinction instead of a linear gradient by putting the second color at 0%

For Example,

Gradient - background: linear-gradient(80deg, #ff0000 20%, #0000ff 80%);

Hard distinction - background: linear-gradient(80deg, #ff0000 20%, #0000ff 0%);

answered Jun 28 by Edureka
• 9,540 points

Related Questions In CSS

0 votes
1 answer

Why is the CSS border-color inheriting the color property?

An element in CSS can have two ...READ MORE

answered Jun 10 in CSS by Edureka
• 9,540 points
12 views
0 votes
1 answer

What is the proper way to display a logo with CSS?

An <img> element is the proper way ...READ MORE

answered Jun 10 in CSS by Edureka
• 9,540 points
28 views
0 votes
1 answer

Position a CSS background image x pixels from the right?

The attribute border can be used as ...READ MORE

answered Jun 10 in CSS by Edureka
• 9,540 points
25 views
0 votes
1 answer
0 votes
0 answers

CSS: background image on background color

If this panel is chosen, a panel ...READ MORE

Jun 22 in CSS by Edureka
• 9,800 points
21 views
0 votes
1 answer

How to make div background color transparent in CSS

To begin, we will build a div> ...READ MORE

answered Jun 28 in CSS by Edureka
• 9,540 points
58 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
4,712 views
0 votes
1 answer

when declaring css styles, what is the meaning of .classA.classB (two class names with a dot in the middle and no space)

The first example (space-separated classes) is a ...READ MORE

answered Jun 28 in CSS by Edureka
• 9,540 points
26 views
0 votes
1 answer

CSS shadow white line at the end of linear-gradient background

This is a byproduct of the gradient ...READ MORE

answered Jun 1 in CSS by Edureka
• 9,540 points
180 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP