Results 1 to 2 of 2

Thread: Text over images

  1. #1
    Join Date
    Jan 2016
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Text over images

    I want my text to appear on top of the images even without the hover.

    HTML Code:
    /* TOP CATEGORIES */
    
    .catWrap {
      position: relative;
      text-align:center;
      font-size: 18px;
      font-weight: 400;
      color: #153d4d !important;
      padding: 0;
      margin: 0;
      visibility: visible;
    }
    .catWrap a{ color: #153d4d !important;
    visibility: visible;
    z-index: 99;
    position: relative;
    }
    
    .catWrap img {
    	z-index: -1;
    	position: relative;
    }
    
    .catDescription {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      background-color: rgba(245, 245, 245, 0.84);
      color: #000;
      z-index: 100;
      height:100%;
      width:100%;
      visibility: visible !important;
      opacity: 0;
      -webkit-transition: visibility opacity 0.2s;
      margin:0;	
      text-align:center;
    }
    
    .catDescription p {
    	padding:20% 0;
    	visibility: visible;
    	color: #000;
    	z-index: 101;
    }
    
    .catDescription a {
    	visibility: visible;
    	color: #000;
    }
    
    .catWrap:hover .catDescription {
    	position: absolute;
    	top: 0;
    	left: 0;
      visibility: visible;
      opacity: 1;
    }
    
    .catWrap .catDescription {
      visibility: visible;
      opacity: 0;
    }
    /* END TOP CATEGORIES */
    HTML Code:
                       <div class="catWrap">
                 <img src="images/saniflo/toilet-kits.jpg" width="230" height="187" alt="toilet pumps"/>
                 <div class="catDescription"><p><a href="http://www.decorisland.com/brandcategory/saniflo/bathroom/toilets-bidets/toilet/toilet-kits/">Toilet<br>Kits</a></p></div>
                 </div>
    Last edited by Beverleyh; 02-10-2016 at 04:46 PM. Reason: repetitive code removed

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Untested - remove this;
    Code:
    .catWrap:hover .catDescription {
    	position: absolute;
    	top: 0;
    	left: 0;
      visibility: visible;
      opacity: 1;
    }
    
    .catWrap .catDescription {
      visibility: visible;
      opacity: 0;
    }
    and opacity:0; from .catDescription
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

Similar Threads

  1. IE6 and IE7 problem text and images
    By spazzer in forum CSS
    Replies: 5
    Last Post: 03-05-2010, 11:34 PM
  2. Resolved CSS Very Basic. (Text via Images)
    By Tye in forum CSS
    Replies: 2
    Last Post: 01-02-2009, 05:04 PM
  3. Resolved Align text around images
    By monique in forum CSS
    Replies: 6
    Last Post: 11-03-2008, 03:25 PM
  4. Help with scrolling text/images
    By puffnstuff in forum HTML
    Replies: 2
    Last Post: 11-08-2007, 04:21 PM
  5. images with text field
    By Alidad in forum JavaScript
    Replies: 3
    Last Post: 01-09-2007, 02:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •