Solved

blue border and header

Posted on 2014-12-11
8
77 Views
Last Modified: 2014-12-14
Hi,

In CSS, I forget how to make a border around a div with a box  header that has a  gradient color blue.
If the browser cant handle the gradient color then I need it to still display a color.
Can someone give me an example please.
0
Comment
Question by:jagguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40495042
Not sure what you mean exactly
Something like this?
http://jsfiddle.net/GaryC123/7k00kg3d/
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40495049
Or something like this
http://jsfiddle.net/GaryC123/7k00kg3d/2/

div {
    height:200px;
    width:200px;
    border:5px solid blue
}
div div {
    height:35px;
    border:none;
    background: -webkit-linear-gradient(blue, lightblue);
    background: -o-linear-gradient(blue, lightblue);
    background: -moz-linear-gradient(blue, lightblue);
    background: linear-gradient(blue, lightblue);
}

Open in new window

0
 

Author Comment

by:jagguy
ID: 40495067
Yes the last one, with a heading in it

What happens if it cant display the gradient for older browsers?
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:jagguy
ID: 40495074
Also the div have class names ? as I need to reproduce it
0
 
LVL 58

Expert Comment

by:Gary
ID: 40495081
If you are just worried about IE8 then add to the css

filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='blue', endColorstr='lightblue', GradientType=0 );

Open in new window

You shouldn't need to worry about the other browsers as they tend to self update to the latest version anyway which all support CSS3
0
 
LVL 58

Expert Comment

by:Gary
ID: 40495082
Then just add your class names and use them in the css instead of div
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40495091
If you need a fallback for browser that don't support gradients just put background:blue; ahead of the gradient declarations and the browsers that can't do gradients will use the blue because they ignore the linear-gradient that they don't understand.

Cd&
0
 
LVL 54

Expert Comment

by:Huseyin KAHRAMAN
ID: 40495113
just add another line inside css like this:

background-color:blue;
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question