How to make heading appear in different colors
Tags: html,css
Problem :
I want my title "Bully-Free Zone" to appear in different colors. I put five titles in order to assign a color for each so that they can kind of look like a gradient. For example, the firs title I want to appear light gray, the second one gray, the third one dark grey, the fourth one gray, and the fifth one light gray. How do I go about assigning different colors because they are all h1 http://imgur.com/tiU0z
HTML
<html>
<head>
<link rel="stylesheet" type="text/css" href="body.css"/>
</head>
<body>
<h1>Bully-Free Zone<br/> Bully-Free Zone <br/> Bully-Free Zone <br/>
Bully-Free Zone <br/>
Bully-Free Zone </h1>
<h2>"Online harassment lhas an off-line impact"</h2>
<!--Menu-->
<div id="nav">
<a href="mainpage.htm" class="nav-link">HOME</a>
<a href="page1.htm" class="nav-link">ASSISTANCE</a>
<a href="page2.htm" class="nav-link">CYBER-BULLYING SIGNS</a>
<a href="page3.htm" class="nav-link">REPORT</a>
</div>
<div id="content"> Your Content Here Your Content Here Your Content Here <br/>
Your Content Here Your Content Here<br/>
Your content here </div>
<img src="nobullying.jpg" id="picture"/>
<!--Copyright-->
<div id="center">
<td> Copyright © 2012 Bully-FreeZone.net</td>
</div>
</body>
</html>
CSS:
body{/* IE10 */
background-image: -ms-linear-gradient(top left, #555BB5 0%, #FC5B5B 100%);
/* Mozilla Firefox */
background-image: -moz-linear-gradient(top left, #555BB5 0%, #FC5B5B 100%);
/* Opera */
background-image: -o-linear-gradient(top left, #555BB5 0%, #FC5B5B 100%, );
/* Webkit (Chrome 11+) */
background-image: -webkit-linear-gradient(top left, #555BB5 0%, #FC5B5B 100%);
/* Proposed W3C Markup */
background-image: linear-gradient(top left, #555BB5 0%, #FC5B5B 100% );
}
h1{color:black;text-align:center;font-size:40px;font-family:broadway;
}
h2{color:black; text-align:center;font-size:27px;font-style:italic;}
/*Menu Buttons Orange*/
a.nav-link:link
{
color: black;
text-decoration: underline;
}
a.nav-link:visited
{
color: black;
text-decoration: none;
}
a.nav-link:hover
{
color:black;
text-decoration: overline;
}
a.nav-link:active
{
color: black;
text-decoration: none;
}
/*Menu button styles*/
#nav{text-align:center; font-family:"Bernard MT Condensed"; font-size:30px;
}
#center{text-align:center;}
#picture{background-image: url(nobullying.jpg);
width:200px;
height:400px;
position:absolute;
left:10px;
Top:190px;
bottom:10px;
}
#content {
text-align:left;
width:550px;
margin:20 auto;
}
Solution :
Add a span around each of the titles and assign a different class to each one. Then you can change the colors via CSS.
<h1>
<span class="gray1">Bully-Free Zone</span><br/>
<span class="gray2">Bully-Free Zone</span><br/>
<span class="gray3">Bully-Free Zone</span><br/>
<span class="gray2">Bully-Free Zone</span><br/>
<span class="gray1">Bully-Free Zone</span>
</h1>
And the CSS...
.gray1 { color: #efefef; }
.gray2 { color: #aaaaaa; }
.gray3 { color: #999999; }
CSS Howto..
Try this: function clicka(num) { var nav = document.getElementById('navbar'), c = nav.children, l = c.length, i; for( i=0; i<l; i++) c[i].className = "unactive"; document.getElementById(num).className = "active"; } // <ul id="navbar"><li...>...</li></ul>...
The problem is that you are not closing your wrapping <div> tags. This should work: <div class="sidebarimagesupermsg"> <img src="https://homepages.cae.wisc.edu/~ece533/images/arctichare.png" syle="width:100%;" alt="super massage" /> <h3 class="h3sidebarimagesupermsg"><span>super<span...
Add this code to your svg in html preserveAspectRatio="xMinYMin meet" also remove from it width and height, and after that you can resize it by changing width and height of...
This is completely untested and I switched to jQuery a while ago so there might be a cleaner way to do this, but this should give you a basic idea....
Use a setTimeout and a clearTimeout. var t = null; window.onResize(function() { if (t!= null) clearTimeout(t); t = setTimeout(function() { ... }, 500); }} During the dragging the timeout is...
Wrap the text inside a span and use a :pseudo-element for the line. Position the line(:pseudo-element) behind the span using z-index: -1, so that you could move around the text...
Something like this perhaps?: HTML: <div id="header">LE BON REFLEXE</div> CSS: div#header { display:inline-block; width:auto; height:20px; padding:5px 20px 5px 10px; background:none #3476A9; color:#fff; font-weight:bold; font-family:arial; position:relative; overflow:visible; } div#header:after { content:'';...
By the way...if anyone is interested...I found a nice elegant solution that is a jQuery plugin that is SOOO nice. It literally is one line of jQuery, a minified js...
Concept: Switch between display: block (the default) and display: table by using media queries. I believe this same tactic can be used to switch to display: flex too, if you'd...
You make them pay for it. Then you can afford to pay someone to do the work. If they refuse to pay for it, you tell them this is out...
Use white-space: nowrap; on the element for which you don't want the text to wrap.
You've got two options: Set your own disabledCls (example). Change the CSS vars of button. ...
I made this example http://jsfiddle.net/efortis/kUfdE/ First, hide it by default in the CSS with display:none .orangeBox{ background: orange; display: none; } Then display it with javascript, equivalent to .css('display', 'block')...
One solution I use requires a known height of your footer. Fiddles: A lot of content A little content Here's the HTML: <main> hello </main> <footer> i am the footer...
Try ~ .title { color: red; } .title ~ div[class^=desc] {/* class name starting with `desc` */ color: blue } <h4 class='title'>Title</h4> <div class='desc1'> <h4 class="lesson1">Test1</h4> </div> <div class='des2'> <!--...
IE won't apply an SVG clip to a html element, so you need an SVG <image> element rather than an <html> img element e.g. * { padding: 0; margin: 0;...
So not much wrong here overall. Just that you have a few extra things you don't need. Namely, bottomDesc and bottomAbout do not need to be floated, and the padding-top...
The difference between the unstyled and styled buttons is that the unstyled buttons don't have an attribute of class="button". You should be able to log into WP, click plugins, click...
You can't. There's no selector that produces the behavior you want in CSS. Every CSS selector can only be used to affect an element and its descendants, not its siblings...
If you are using JavaScript, this code fragment will distinguish Safari from Chrome: if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { $('html').addClass('safari-only'); } For a CSS-only hack, try this...
You have two options here: Remove position: absolute and change the <span> tag to a <div> tag Remove the position: absolute and add the property display: block within the .inner_quote...
You could try any of the following, Vanilla window.onresize = function(event) { /** Your code here. **/ }; jQuery $(window).resize(function() { /** Your code here. **/ }); or A CSS...
If I understand well your question, you want to know if it is possible to include HTML content into a TEXTAREA element. That is not possible, but you can look...
<% = WebResource("image1.jpg") %> You can use above statement inside your CSS file, and while you register your CSS with WebResourceAttribute, you can set "PerformSubstitution" to true Default.css body{ background:...
AFAIK both stylus and sass do not support importing only certain selectors of a file. If you have control over the imported file, though, you could use SASS placeholder selectors...
I think that definition lists are pretty close semantically to name/value pairs. <dl> <dt>Name</dt> <dd>Value</dd> </dl> Definition lists - misused or misunderstood?...
If your width value is inside the tag you can use document.getElementById("id").style.width. But if your css is inside a tag style, that's going to make you use jquery for a...
With an horizontal padding? padding-left:5px , padding-right:5px; Or you can use relative positioning and a distance from left: ul li:nth-child(2) { /* second item */ position:relative; left:5px; } ul li:nth-child(3)...
Your css refers to .style2 body, which is looking for a body element contained inside of an element with the .style2 class. If you want to style only body when...
Much of the refactoring work is the same with or without Compass and you'll see the benefits that Sass offers sooner than those of Compass. Compass creator Chris Eppstein did...