Jump to content

Help me soon


Recommended Posts

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 post
Share on other sites

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 post
Share on other sites
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>

Thanks... But where to write the css code?
Link to post
Share on other sites
Guest Acid_ICE24
Thanks... But where to write the css code?

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 post
Share on other sites

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 post
Share on other sites
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

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...