Wednesday, October 26, 2016

Image Tag & Color Change

The <img> tag defines and image in an HTML page.  It has two required attributes: src and alt.  However, images are not actually inserted into an HTML page.  The tag creates a holding space for the image. 

<img> example:

<!DOCTYPE html>
<html>
<body>

<img src="smiley.gif" alt="Smiley face" width="42" height="42">

</body>
</html> 


In this example, if you change the color value in 'background-color' you are able to change the color of the button that displays on your HTML page.

<!DOCTYPE html>
<html>
<head>
<style>
.button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
}
</style>
</head>
<body>

<h2>CSS Buttons</h2>

<button>Default Button</button>
<a href="#" class="button">Link Button</a>
<button class="button">Button</button>
<input type="button" class="button" value="Input Button">

</body>
</html>
For example, if you change the value to #000000, you can change the color to black.  

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Cesarini_Final

I hope you have a great Holiday break!!! EmCesarini.github.io Website Direct Link