Current Articles
       Tag
              bio (3)
              calendar (1)
              CSS (7)
              design (1)
              DOS (1)
              embed (2)
              examples (4)
              google (1)
              happy time (1)
              HTML (3)
              Javascript (3)
              projects (10)
              resources (3)
              TECHS (9)
              VB.NET (3)
              Windows Forms (2)
              XML (1)
       Date
       Author
       Keyword
  Archived Articles
  TECHS Articles
  Current Projects
  About Us
You are not logged in.

Please either Login or create a New Account.
Custom RSS

Note: this links is the RSS feed for the current filters shown at the top of the page. For an RSS feed for all articles in this community, click here
  Viewing Archived Articles
Tag
CSS (1)
Problem:  Lots of text that it important to the page, but only if the user wants to see it.  This comes from displaying an rss feed.  I wanted to present the "headlines" of the feed and allow the user to view the details without a click. 

Solution:  CSS hover to display the text of each feed article.

Here is how it works.

1. I have a div tag for the headline, and inside of that a span tag for the article details.
<div>headline
<span> article </span>
</div>

2. I add a style element with a css class that assigns the span tag to not be displayed.
.headline span {display:none;}

3. Then a hover for the headline class.  These lines allow the text to be positioned relative to the outer div element and puts a background color in there to keep things readable.
.headline:hover {position:relative;}
.headline:hover span {display: block;position: absolute; top: 30px; left: 0; margin-left:10px; background-color:#F6EDE2; border-style:solid; border-width:1px; padding:3px; }

Here is an example of what this looks like...

Headline 1 Article 1 - Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover. Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover. Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
Headline 2 Article 2 - Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover. Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover. Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
Headline 3 Article 3 - Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover. Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover. Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
Headline 4 Article 4 - Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover. Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover. Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.



 

Here is the code used in the above sample...

<style type="text/css">
<!--
.headline:hover {position:relative;}
.headline span {display: none;}
.headline:hover span {display: block;position: absolute; top: 30px; left: 0; margin-left:10px; background-color:#F6EDE2; border-style:solid; border-width:1px; padding:3px; }
-->
</style>
<div class=headline>
Headline 1
<span>Article 1 - Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
</span>
</div>
<div class=headline>
Headline 2
<span>Article 2 - Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
</span>
</div>
<div class=headline>
Headline 3
<span>Article 3 - Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
</span>
</div>
<div class=headline>
Headline 4
<span>Article 4 - Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
Details of the article that I don't want to junk things up with, but need to be handy to the user in a hover.
</span>
</div>

Tags: CSS



  1