The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

HTML background problem

4 posters

Go down

In progress HTML background problem

Post by angel_of_night May 7th 2014, 1:55 pm

Hello,

I am trying to make a HTML page for my forum. I am trying to use the following code to make a background with an image:

Code:
<html>
<body background="test.jpg">
<h1>test</h1>
</body>
</html>

But for some reason, when I press "submit" the code just disappears, making the page without a background.
If I try to press "preview" it works fine though.
What am I doing wrong?

Thank you
angel_of_night
angel_of_night
Forumember

Female Posts : 565
Reputation : 10
Language : portuguese

Back to top Go down

In progress Re: HTML background problem

Post by Pizza Boi May 7th 2014, 2:19 pm

Hi Very Happy

Because in this portion:

Code:
body background="test.jpg">

The 'test.jpg' only works on your computer and not on the website itself. If you upload the picture and get its direct link, replace the 'test.jpg' with it and that should be fine.

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

In progress Re: HTML background problem

Post by angel_of_night May 7th 2014, 2:27 pm

I am actually using this link for the background https://2img.net/r/ihimizer/img831/7024/bgbod10.gif
Also tried imgur, the result is the same.
angel_of_night
angel_of_night
Forumember

Female Posts : 565
Reputation : 10
Language : portuguese

Back to top Go down

In progress Re: HTML background problem

Post by Michael_vx May 7th 2014, 2:46 pm

as i guess this code works fine with me like 100% for HTML of course

Code:
<style type="text/css">
    /* Michael_vx */
body
{
   background: url(http://yamiejung21.webs.com/photos/CC1/k46.jpg) repeat-y fixed center top;
   color: #000000;
   margin: 0px 0px 0px 0px;
   padding: 0px;
   }
    </style>
and it never disappears from the HTML page
Michael_vx
Michael_vx
Forumember

Male Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

In progress Re: HTML background problem

Post by angel_of_night May 7th 2014, 4:34 pm

Hmmm weird, I found out if I write it in WYSIWYG mode, the codes mess up, but if I do in HTML mode, they stay fine.
Uhg, now I will have to edit everything manually.
Thanks for the help.
angel_of_night
angel_of_night
Forumember

Female Posts : 565
Reputation : 10
Language : portuguese

Back to top Go down

In progress Re: HTML background problem

Post by Ange Tuteur May 8th 2014, 5:12 am

Hello,

The sceditor does not support the background attribute, use the style attribute instead.

Ex :
Code:
<body style="background:url('/myimg.gif')">elements</body>

The background attibute should be supported in advanced mode which I highly recommend for editing and creating HTML pages.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: HTML background problem

Post by Pizza Boi May 8th 2014, 6:11 am

Hi Very Happy

Also, Ange, whenever we use font-family and color, it replicates it in the original post, messing it up. Is that a thing with FM or is it just our forum? (It happens when we use class tables).

Anyway, @OP, in case you also experience this problem (With any HTML related background thing), I would highly suggest just declaring a name for it and if you don't want to use the CSS, you can use something like:

Code:
<html>
<script type="text/CSS">
body.myclass {
  /* Style */
}
</script>
<body class="myclass">
/* Contents */
</body>
</html>

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

In progress Re: HTML background problem

Post by Ange Tuteur May 8th 2014, 6:34 am

From what I recall with bbcodes, setting the color in the parent style attribute will cause the editor to enter color tags endlessly on its children until the property is removed.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: HTML background problem

Post by Pizza Boi May 8th 2014, 6:42 am

Hi Very Happy

So technically, when using it, it's either we just use the default BBC code or have it in the CSS? What the fuck ?!?

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

In progress Re: HTML background problem

Post by Ange Tuteur May 8th 2014, 6:45 am

If it is in your stylesheet it wont matter. When it is in an inline style of an element, that is when tags such as color or bold will constantly duplicate on the children elements.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: HTML background problem

Post by Pizza Boi May 8th 2014, 6:48 am

Hi Very Happy

Okay, thanks so much Ange :rose: . I'll give my staff a heads-up about this one I love you .

@OP: Sorry for asking in your topic, lol.

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum