Interactive Tracker Boxes #2 - CSS
Submitted by Yorkiebar on Monday, September 22, 2014 - 09:49.
Introduction:
This is the second part of my interactive tracker boxes in HTML, CSS, and jQuery. This part will be covering styling the classes of our elements using CSS3.Box:
The box class will be the holder of the points/trackers where the user is able to hover their mouse over in order to get responsive information about appropriate content. For this, I am going to do a simple small box with white background, and black border...- .box {
- width: 50px;
- height: 50px;
- border: 1px solid #0a0a0a;
- background-color: #ffffff;
- }
Boxes:
The boxes class will be the container of our 'box' classes (the trackers container). This just need to be a width and height of where you want your trackers to appear...- .boxes {
- width: 100%;
- height: 500px;
- background-color: #ffffff;
- }
Information:
Finally, the information class will contain the information that we are going to be dynamically changing once one of the trackers are hovered over with the user's mouse. So this will be mostly font styling. First we want to set the area where the text can go, with the width and height properties...- .information {
- width: 500px;
- margin: 0px auto;
- }
- color: #0a0a0a;
- background-color: #ffffff;
- font-family: Verdana;
- font-size: 18px;
- font-weight: normal;
Linking:
As I am using my CSS in an external file away from the HTML file, I need to link the HTML file to the CSS in order to include the styling, if you need to also do this (if you're not using inline styling), you can add the following line to your 'head' tags of your HTML file...- <link rel='stylesheet' type='text/css' href='tracker.css' />
Finished!
Here is the full CSS source code...- .box {
- width: 50px;
- height: 50px;
- border: 1px solid #0a0a0a;
- background-color: #ffffff;
- }
- .boxes {
- width: 100%;
- height: 500px;
- background-color: #ffffff;
- }
- .information {
- width: 500px;
- margin: 0px auto;
- font-family: Verdana;
- font-size: 18px;
- font-weight: normal;
- color: #0a0a0a;
- background-color: #ffffff;
- }
Add new comment
- 25 views