Solved

blue border and header

Posted on 2014-12-11
8
71 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
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
 

Author Comment

by:jagguy
ID: 40495074
Also the div have class names ? as I need to reproduce it
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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 51

Expert Comment

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

background-color:blue;
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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 …

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now