Ruud Hermans Posted October 7, 2006 Share Posted October 7, 2006 OK, here it goes, I hardly used CSS in the past and want to start with it now.Far as I'm aware isn't it possible to create your own tag that you could use in a file to call an image and center it?If I'm right could some one give an example of this feature?Ruud Hermans Link to comment Share on other sites More sharing options...
scott100 Posted October 7, 2006 Share Posted October 7, 2006 OK, here it goes, I hardly used CSS in the past and want to start with it now.Far as I'm aware isn't it possible to create your own tag that you could use in a file to call an image and center it?If I'm right could some one give an example of this feature?Ruud HermansYou can't create your own tags with css, but you can create your own classes and apply them to existing html tags.In this example i have said - center the contents of all divs only if they have class "image". (i made this up, image could be called potatoes or whatever!)<head><style type="text/css">div.image {text-align: center}</style></head><body><div class="image"><img src="http://www.w3schools.com/images/w3default80.jpg"></div></body> There are of course many ways to do one job with css Link to comment Share on other sites More sharing options...
Ruud Hermans Posted October 7, 2006 Author Share Posted October 7, 2006 Call me crazy but soon as I do: body {background-image: url('afbeeldingen/afbeelding1.gif') no-repeat fixed center; } My image is gone from my page.I need to set it as a background and center it on the page vertically but when ever I try to add something to it it dissapears for some wierd reason.Ruud HermansHum, yeah got it forhot to put a ";".An other question is there any way you can use CSS to make the image a watermark? Link to comment Share on other sites More sharing options...
scott100 Posted October 7, 2006 Share Posted October 7, 2006 Call me crazy but soon as I do:body {background-image: url('afbeeldingen/afbeelding1.gif') no-repeat fixed center; } My image is gone from my page.I need to set it as a background and center it on the page vertically but when ever I try to add something to it it dissapears for some wierd reason.Ruud Hermans You have said background-image but added other values, remove -image and it should work.trybody {background: url('afbeeldingen/afbeelding1.gif') no-repeat fixed center; } http://www.w3schools.com/css/tryit.asp?fil...ycss_backgroundbackground can have all thesebackground-colorbackground-imagebackground-repeatbackground-attachmentbackground-position Link to comment Share on other sites More sharing options...
Ruud Hermans Posted October 7, 2006 Author Share Posted October 7, 2006 About the other question?is there any way you can use CSS to make the image a watermark?Ruud Hermans Link to comment Share on other sites More sharing options...
scott100 Posted October 7, 2006 Share Posted October 7, 2006 About the other question?is there any way you can use CSS to make the image a watermark?Ruud HermansYou would just use the code above along with an image that has been made lighter by an image editorhttp://www.w3schools.com/dhtml/tryit.asp?f...l_css_watermark 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