Jump to content

HELP with HTML and CSS coding


Guest RET.CWO2.Shortstacks=US=

Recommended Posts

Guest RET.CWO2.Shortstacks=US=
Center statement is needed

 

Sent from my SAMSUNG-SM-N900A using Tapatalk

 

isn't that the center statement:

Welcome to my Website

Link to comment
Share on other sites

Guest FaTaLSkies57

I can't show it in the forums even with mistakes in it so it's just center with brackets the text and /center with brackets.

 

Sent from my SAMSUNG-SM-N900A using Tapatalk

Link to comment
Share on other sites

Guest RET.CWO2.Shortstacks=US=
Use "
text
*>" inside

 

Sent from my SAMSUNG-SM-N900A using Tapatalk

 

Welcome to my Website
like that?
Link to comment
Share on other sites

Guest RET.CW4.ThievingSix=US=

In css, to align some text the code is "text-align: center;" it is generally preferred over

. A CSS file reduces the page load time by caching the style sheet which is used across your website. Instead of having to load the style each time the page loads.

 

The way i would do it is to declare the alignment in CSS. Your code should work without "style=align:center;" however if you wanted to include that tag, it needs to include quotation marks like this

Welcome to my Website

 

Here's an example of what i mean, the Top left is HTML, top right is CSS, bottom right is the result. http://jsfiddle.net/7VXNR/

Link to comment
Share on other sites

Guest RET.LT.Padarom=US=

Alternatively you could use what you've tried already:

Welcome to my Website

That should work as well (attribute values always have to be surrounded by double or single quotes).

 

But is good practice to always separate HTML and CSS (which means not to use any style-attributes at all, and instead define everything in your second.css).

In your case I would use a text-align: center in your CSS-file, rather than using the center-tag.

 

See this link -

is no longer supported in HTML5. Your doctype states that you use HTML5, so actually it'll become invalid. Not that it matters too much when you're just learning to code. However if you want to continue coding after school, noticing things like this will prevent problems in the future.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...