Ask your own question, for FREE!
Computer Science 22 Online
jagr2713 (jagr2713):

How do you put text on a picture in html ?

OpenStudy (woodrow73):

I made an example with a bit of css https://jsfiddle.net/wamtnsk6/ html: ``` <img id="pic" src=" http://pre03.deviantart.net/d624/th/pre/i/2013/226/7/6/miracles_by_fanke-d6i38c1.jpg " alt="art by Paulius Pamiskis"> </img> <div id="text"> fly </div> ``` css: ``` #text { position: relative; bottom: 500px; left: 120px; font-size: 20px; z-index: 5; color: purple; } ``` Doing position: relative; will enable you to change the element's position on the screen with the bottom: ; top: ; left: ; right: ; attributes. Doing bottom: 500px; will essentially boost the element up 500px.

jagr2713 (jagr2713):

I forgot what z-index does, can you tell me

OpenStudy (woodrow73):

Doesn't seem it's necessary in the example I posted, though z-index is responsible for describing which elements go ontop of other elements. So an element with a z-index of 2 will be ontop of an element with a z-index of 1. Though also note that "z-index only works on positioned elements (position:absolute, position:relative, or position:fixed)" - w3schools http://www.w3schools.com/cssref/pr_pos_z-index.asp

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!