aND|e Posted December 7, 2005 Share Posted December 7, 2005 I was just wondering if its possible to have a text, lets say a whole paragraph (<p>) on top of an image? so, it'll be like a background for a specific froup of text. hope someone can help me thanks again soooo much! Link to comment Share on other sites More sharing options...
Mimika Posted December 7, 2005 Share Posted December 7, 2005 layors should do the trick Link to comment Share on other sites More sharing options...
aND|e Posted December 7, 2005 Author Share Posted December 7, 2005 found the answer in my book on css already..thanks Mimika! Link to comment Share on other sites More sharing options...
aND|e Posted December 7, 2005 Author Share Posted December 7, 2005 Mimika help! I can't understand what the book says on what to do about changing the text's background. its says type background: then type transparent or color, where colors is a color name or hex color. and if i want, i can also use an image by typing url (image.gif) instead. in this case i want to use an image. can you tell me what's the exact css code for this? i'd really appreciate it! Link to comment Share on other sites More sharing options...
Jonas Posted December 7, 2005 Share Posted December 7, 2005 http://www.w3schools.com/css/css_background.aspIn your case:p {background-image: url('image_name.extension');background-color: #??????; /* Color to use if image for some reason doesn't render */}orp {background: url('image_name.extension') #??????;} Link to comment Share on other sites More sharing options...
aND|e Posted December 8, 2005 Author Share Posted December 8, 2005 jonas you're a life saver! Let me try that out..thanks again! Link to comment Share on other sites More sharing options...
aND|e Posted December 8, 2005 Author Share Posted December 8, 2005 hmm..i think it worked but the image was so small i had to check twice if it was the image or just dirt on my screen. haha! what if i just want it on 1 paragraph on my page Jonas? Correct me if I'm wrong but the code you posted will make every paragraph on my page have the same text background image, is that right? and how do i position the image and paragraph on the page? thanks a bunch! Link to comment Share on other sites More sharing options...
Jonas Posted December 8, 2005 Share Posted December 8, 2005 p#id_name {background: url('image_name.extension') #hexdeclaration;position: absolute;left: ?px; /* Pixels from the left */top: ?px; /* Pixels from top */width: ?px; /* Paragraph width, if you want to make sure it's the same width as your picture */height: ?px; /* Paragraph height, if you want to make sure it's the same height as your picture /*}<p id="id_name">Text with background image...</p> Link to comment Share on other sites More sharing options...
aND|e Posted December 8, 2005 Author Share Posted December 8, 2005 thanks Jonas! it almost worked except that only the upper left corner of the image was visible on the page. why is that? is the image too large? Link to comment Share on other sites More sharing options...
Mimika Posted December 8, 2005 Share Posted December 8, 2005 If its for the background add this into your css filebackground-repeat: no-repeat; Link to comment Share on other sites More sharing options...
aND|e Posted December 8, 2005 Author Share Posted December 8, 2005 Mikika it's for a paragraph's background. do i still need that? will this solve my problem regarding the image, that i only see 1/4 of the image (upper left)? Link to comment Share on other sites More sharing options...
Mimika Posted December 8, 2005 Share Posted December 8, 2005 well if you just see 1/4 of the img then its to big. I thought the img was repeating(need more coffee).well how big is the img. and how big you want the page to be ?I'd recomend 1024x768 (standard size this time iam awake hehe) then just make the picture the same size then its 100% fitand about the paragraph background-repeat: no-repeat;this will just make the background to not repeat it self in x or y for thouse who got bigger screens its ###### to see repeats hehe hope it gets in use ^^x=horosontaly=verticalbtw do you got a link to your work I'm kinda curius Link to comment Share on other sites More sharing options...
aND|e Posted December 8, 2005 Author Share Posted December 8, 2005 haha..ok i'll give it a try..actually its not the background for the whole page..i just want a paragraph to have a background (instead of using a color, i want to use an image). i'm still a little embarrassed since im just doing basic stuff. i just started learning about a couple of weeks ago as soon as i have everything organized ill start giving the link when i ask for help..haha! so basically i just want a background for my text, not the whole page Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now