How to change the background color of a span/div WITHOUT CSS [closed]


Tags: html,css

Problem :

I'm building an alert page. I'm trying to make the page work even if javascript and CSS is failing.

I would like to use maybe deprecate HTML codes to do this. I need the span that contains the alert message to have a red background.

Please advise.



Solution :

You can use the bgcolor attribute to set the background colour, but it's far better to use CSS to style a page as the bgcolor attribute only works on certain tags.

<table bgcolor="#FF0000"><tr><td> My alert contents </td></tr></table>

For example it won't work on <span>, <div> or <p> tags, but will work on <body> and <table> tags.


    CSS Howto..

    How to understand this CSS Menu Demo? [closed]

    How to center a textarea using CSS?

    How to fade in a specific CSS property

    How does Grails process static files without resources plugin?

    HTML CSS How to stop a table to put the content after it on a new line?

    CSS Selector-How to locate Parent Element

    how to put all labels in bold with css

    how to prevent form height increase on every click in Internet Explorer 9 in jqGrid

    Not sure how to use css selectors

    How do I remove the text underline (that I set myself) from a on hover?

    How to have jquery add a panel inside a panel in Bootstrap v3

    How to style for only non-touch devices in css?

    How can I display these images with CSS instead of HTML?

    Load More / Show Less issues using jquery

    How to make scrollable table's header fixed using css fixed position property?

    how to animate a div towards different direction and fade out using jquery

    How to extract attribute values using css selectors?

    How to make link unclickable using CSS or jquery? [duplicate]

    Bootstrap - How to ensure white space on far left and far right on mobile

    How to have multiple borders on div using css

    How can I remove comments on-fly from my static CSS files?

    How to place a Show/Hide toggle button next to a header (not under the header)?

    How to center text vertically in a flex box?

    How to correct css for IE?

    How to remove space from top of web page

    How to make a fully responsive web page [closed]

    How to change an image on mouseover of wrapper div

    How to stop animation using jQuery

    How to force free CSS resize on input element when its width is specified?

    Javascript: how to check/delete a css style tag in the head of the document