CSS Set A Background Color Which Is 50 Of The Width Of The Window

186299/css-set-background-color-which-is-50-of-the-width-of-the-window

  • Home
  • Community
  • Categories
  • Web Development
  • CSS
  • CSS Set a background color which is 50 of the...
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?

  • css
  • background-color
Jun 27, 2022 in CSS by Edureka 13,750 points 4,932 views answer comment
  • flag

Your comment on this question:

Your name to display (optional):
Email me at this address if a comment is added after mine:
Privacy: Your email address will only be used for sending these notifications.
Add comment Cancel

1 answer to this question.

Your answer

Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Privacy: Your email address will only be used for sending these notifications.
Add answer Cancel
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, 2022 by Edureka 12,720 points comment
  • flag
  • ask related question

Your comment on this answer:

Your name to display (optional):
Email me at this address if a comment is added after mine:
Privacy: Your email address will only be used for sending these notifications.
Add comment Cancel

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, 2022 in CSS by Edureka 12,720 points 1,287 views
  • css
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, 2022 in CSS by Edureka 12,720 points 1,370 views
  • css
  • graphical-logo
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, 2022 in CSS by Edureka 12,720 points 1,485 views
  • css
0 votes 1 answer

CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the page

A simple solution is to make the ...READ MORE

answered Jun 21, 2022 in CSS by Edureka 12,720 points 5,103 views
  • css
  • footer
0 votes 0 answers

CSS: background image on background color

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

Jun 22, 2022 in CSS by Edureka 13,750 points 1,027 views
  • css
  • background
  • background-image
  • background-color
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, 2022 in CSS by Edureka 12,720 points 3,247 views
  • css
  • html
  • background-color
  • transparent
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 13,410 views
  • mysql
  • linux-database
  • linux
  • php
  • html
  • css
0 votes 1 answer

How to get custom fonts on static aws site

I see this is an old post ...READ MORE

answered Sep 25, 2018 in AWS by Priyaj 58,020 points 3,387 views
  • css
  • twitter-bootstrap
  • amazon-web-services
  • amazon-s3
  • storage-service
  • aws-storage-services
  • aws-services
  • font-face
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, 2022 in CSS by Edureka 12,720 points 1,374 views
  • css
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, 2022 in CSS by Edureka 12,720 points 3,481 views
  • css
  • background
  • linear-gradients

Recent in CSS

  • How can a:hover be implemented using inline CSS styles in React? Feb 12
  • How can you implement flexbox for layout in CSS? Dec 16, 2024
  • How to select parent element in CSS? Dec 6, 2024
  • Hovering over button highlights entire table Nov 9, 2022
  • Hovering over button highlights entire table Nov 9, 2022
  • All categories
  • Generative AI Generative AI (1,454)
  • Power BI Power BI (1,316)
  • DevOps & Agile DevOps & Agile (4,138)
  • Data Science Data Science (100)
  • ChatGPT ChatGPT (30)
  • Cyber Security & Ethical Hacking Cyber Security & Ethical Hacking (1,057)
  • Data Analytics Data Analytics (1,266)
  • Cloud Computing Cloud Computing (4,053)
  • Machine Learning Machine Learning (337)
  • PMP PMP (1,069)
  • Python Python (3,489)
  • SalesForce SalesForce (201)
  • Selenium Selenium (1,624)
  • Software Testing Software Testing (58)
  • Tableau Tableau (608)
  • Web Development Web Development (3,972)
  • UI UX Design UI UX Design (24)
  • Java Java (1,358)
  • Azure Azure (157)
  • Database Database (858)
  • Big Data Hadoop Big Data Hadoop (1,907)
  • Blockchain Blockchain (1,673)
  • Digital Marketing Digital Marketing (121)
  • C# C# (141)
  • C++ C++ (272)
  • IoT (Internet of Things) IoT (Internet of Things) (390)
  • Kotlin Kotlin (8)
  • Linux Administration Linux Administration (389)
  • MicroStrategy MicroStrategy (7)
  • Mobile Development Mobile Development (395)
  • Others Others (2,387)
  • RPA RPA (653)
  • Talend Talend (73)
  • TypeSript TypeSript (124)
  • Apache Kafka Apache Kafka (84)
  • Apache Spark Apache Spark (596)
  • Career Counselling Career Counselling (1,091)
  • Events & Trending Topics Events & Trending Topics (28)
  • Ask us Anything! Ask us Anything! (71)

Join the world's most active Tech Community!

Welcome back to the World's most active Tech Community!

Sign up with Gmail Sign up with Facebook

OR

Password must have

At least 1 upper-case and 1 lower-case letter

Minimum 8 characters and Maximum 50 characters

SIGN UP Already have an Edureka Account? Login Forgot Password? LOGIN Don’t have edureka account? Sign Up resend ? Password must have

At least 1 upper-case and 1 lower-case letter

Minimum 8 characters and Maximum 50 characters

reset password Don’t have edureka account? Sign Up reset password Don’t have edureka account? Sign Up Send Code Don’t have edureka account? Sign Up

Subscribe to our Newsletter, and get personalized recommendations.

Google Sign up with Google facebook Signup with Facebook

Already have an account? Sign in.

webinar REGISTER FOR FREE WEBINAR X Years of Experience* Student 0-2 Years 2-5 Years 5-10 Years 10+ Years REGISTER NOW webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP "PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.

Từ khóa » Html Css Two Color Background