How does one align and centre both images(jpgs/gifs etc) and text (in document.write("") method) in javascript in an html doc?
So for example an image is centred at the top of the browser and text is centred or aligned right or left?
Also what fonts are supported by javascript and how to change font and size please.
javascript does not perform any formatting. this is done by the html that surrounds the javascript. to center an element, you sould use the text-align style for the parent elemtent eg
Code:
<div style="text-align:center">
Your text in here
</div>
will center the text within that div. You can access the style properties of an element using javascript, but that's only necessary if you want that style property to be dynamic.
Similarly, fonts are not supported by javascript, but by html telling the browser what fonts to use. The actual fonts available are generally determined by the user's browser (again, it is possible to embed fonts in a document. This is html and generally not worth the effort and bandwidth it requires).
below is an idea of what im trying to do.
----------------------------------------------------------------------------------
image.jpg(top center)
(<p> or <br> for space btw image and text
Text will go here in this format in the middle and
center of the browser each line underneath itself
neatly!
//Then a Name in the left and right corner of the browser//
Name of person Name of Person
Then the name of a company here
and below their moto
------------------------------------------------------------------------------------
im busy learning hmtl and javascript .not having a problem with the image file its just getting text etc where the boss wants it!
now the name in the left hand corner and the name in the right hand corner of the browser below the image and text.
also fonts! what fonts are supported by html? i know its
<font face ="arial"></font> to change but ive tried some other fonts such as old english etc and its not supported.
another more complex question(if u know about it) how about repeating an image in a strip on a page.I know about <body background = "... .jpg"> to make the background an image but is it possible to alter it so you can write text over the image and make the text visible.So that the image is repeated in a strip and not the entire background.
Wellp, first of all, any font you can think of works with HTML. The thing is, the user has to have that font saved onto their computer for them to be able to view it, so you want to try to stay simple. Times New Roman and Arial are sure bets, but there are plenty of others.
Your background image tiling vertically, you use CSS for. Simple, really.
You add the style tag into your body tag right after you specify the location of your image. It makes the background image tile vertically down the page.
Originally posted by Buzz ... I need to master server side scripts like asp,perl etc. ...
where do you think I should start and what do you think I should start with learning server side scripts? ...
3 letters one programming language.
PHP - its just the best
i went to a book store near me and bought a PHP book, its a little overwhelming because its so big, but its not actually very bad.
the language is really awsome, cost me 50 dollars