cerebrosys Posted October 21, 2005 Share Posted October 21, 2005 Hi All, I am trying to set a jpg file as background. so i am doing <body background="boat.jpg">Here the problem is, The image size is around 700x600 which is smaller than my ie screen size. so the image is tiled (displayed full + again part of that at the bottom and right). I want to fit it to the window. how to do it.Then,<body> hai</body>i want to align this hai at right. how to do this..This is very basic.. i just started to learn. so u ppl guide me.Regards,chandru Link to comment Share on other sites More sharing options...
F-Man Posted October 21, 2005 Share Posted October 21, 2005 I highly recommend that you start learning CSS as well.For your background, use this in a CSS style sheet instead. html { background-color: black /* Just an example */ background-image: url('boat.jpg'); background-attachment: fixed; background-position: center;} Feel free to remove what you don't need, here is a shorter way of doing the above as well: html { background: black url('boat.jpg') fixed center;} As for the text align... body { text-align: right;} For the whole page, for just a paragraph replace the 'body' selector by let's say... '.rightparagraph' (dot included) and then use this in the body of your HTML: <p class="rightparagraph">hai</p> Link to comment Share on other sites More sharing options...
cerebrosys Posted October 21, 2005 Author Share Posted October 21, 2005 I highly recommend that you start learning CSS as well.For your background, use this in a CSS style sheet instead.html { background-color: black /* Just an example */ background-image: url('boat.jpg'); background-attachment: fixed; background-position: center;} Feel free to remove what you don't need, here is a shorter way of doing the above as well: html { background: black url('boat.jpg') fixed center;} As for the text align... body { text-align: right;} For the whole page, for just a paragraph replace the 'body' selector by let's say... '.rightparagraph' (dot included) and then use this in the body of your HTML: <p class="rightparagraph">hai</p> <{POST_SNAPBACK}> Thanks... But where to write the css code? Link to comment Share on other sites More sharing options...
Guest Acid_ICE24 Posted October 21, 2005 Share Posted October 21, 2005 Thanks... But where to write the css code?<{POST_SNAPBACK}> you can put the css code in between the "style" tag, inside the "head" tag.like this:<head> <style type="text/css"> html {background: black url('boat.jpg') fixed center;} body {text-align: right;} </style></head> Happy coding! Link to comment Share on other sites More sharing options...
MadPotato Posted October 21, 2005 Share Posted October 21, 2005 or you can put in an external file, with extension .css, and link it to your page (any number of pages)in each page that you want to link to an .css file, use: <link type="text/css" rel="stylesheet" href="file_name.css"> try to save the file with this content:file_name.css body { background-color: black; font-family: verdana; font-size: 25px; } doing this, you'll have the config. of the layout from a entire web system in a single file, and changing it, you'll change all the pages Link to comment Share on other sites More sharing options...
Coolprogram Posted October 22, 2005 Share Posted October 22, 2005 Hi All, I am trying to set a jpg file as background. so i am doing <body background="boat.jpg">Here the problem is, The image size is around 700x600 which is smaller than my ie screen size. so the image is tiled (displayed full + again part of that at the bottom and right). I want to fit it to the window. how to do it.Then,<body> hai</body>i want to align this hai at right. how to do this..This is very basic.. i just started to learn. so u ppl guide me.Regards,chandru<{POST_SNAPBACK}> Okay here is an HTML version with a little css of what you are trying to do if i am correct.<style type="text/css"> body { background:url("path/to/background.jpg") no-repeat; } </style> Oh and for aligning hai all you have to do is this:\ <p align="right"> I hope this helps you.-Coolprogram 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