Friday, 15 April 2011

jquery - Placing image in front of background -


I have a section that slides with a blue background, I try to put a picture in the upper left corner I am doing it but it is hard to see and the blue background disappears.

HTML part:

  & lt; Header ID = "Main" & gt; & Lt; A href = "#" id = "stackoverflow" class = "symbol" & gt; & Lt; / A & gt; & Lt; / Header & gt; & Lt; Section id = "stack" category = "news" & gt; & Lt; / Section & gt; Click (function () {$ ('# stack'). Toggle ('Slow')   

, $ St); $ ('# Stack') CSS ({'background': 'url (stack.jpeg) no-repeat', 'position': 'absolute', 'z-index': '1'});});

CSS:

  #stack {float: left; } .news {status: Completed; Z-index: -1; Width: 600px; Background color: # 0000FF; Padding: 10px; Range radius: 10px; Box-shadow: 3px 2px 3px # 000; }. A {status: absolute; Text-decoration: None; Color: #fff; }. News: Hover {Color: # DC-692e; } .news td {padding: 5px 10px; Border bottom: 2px #fff solid; }   

By putting an image in the corner I do not try to: here Enter an image description

When I try to add an image to the corner, here's a picture:  Enter image details here

Thanks!

Due to the blue back ground is disappearing, due to overwriting your background. What you can get after:

  $ ('# stackoverflow'). Click (function () {$ ('# stack') toggle ('slow' $ st); $ ('# stack'). CSS ({'background': 'url (stack.jpeg) No-racquet blue ',' Position ':' complete ',' z-index ':' 1 '});}); Apart from this, after placing the image in the background, I say that adding some padding at the top of the element means that the text does not eliminate your image. .  

A better solution is to actually inject that image into a particular element. IE:

  $ ('# stack'). Prepaid ('& lt; img id = "theImg" src = "theImg.jpg" / & gt;')    

No comments:

Post a Comment