Jump to content

use of class selector (NEWBIE)


brynn

Recommended Posts

Hi Friends,I'm very new to CSS, and fairly new to coding webpages as well. But I do know the very most basic kind of HTML. However, some of the tags I would have been using are not supported in HTML5. So I'm trying to learn CSS. The problem I'm having, is that I'm trying to use CSS code to write an article, in the Simple Machines Forum's, Tiny Portal mod's articles feature. The code I've written, both in the Internal Style format, and Inline Style format, work in the browser by itself. But when I insert it into a Tiny Portal article, it ends up picking up parts of the portal itself, and putting it into the article as well. I'll put my code below, and then I'll attach a screenshot of the result. The site where I want to put the articles isn't open yet, so you wouldn't be able to see the articles via direct link. What I think is happening, is that the code I've written is somehow affecting the code that creates the site itself. I was thinking that I could maybe use the class selector, to make the article sort of separate from the rest of the site. But I'm not sure exactly where to start using class. My 1st thought was using with the <body> tag, like <body class=whatever>. But something tells me that's not quite the best solution. And I realize that whoever reads or answers this may have not idea how the SMF Tiny Portal articles feature works. I'm just hoping the screenshot will show you what's going wrong. Internal style:

<!DOCTYPE html><html><head><style>body{background-color:#ffffff;background-image:url('http://forum.inkscapecommunity.com/tp-images/img/a-art2.png'); background-repeat:no-repeat;background-position:center top;font-size:100%;font-family:Verdana,Geneva,sans-serif;margin-right:20%;margin-left:20%;}h1{text-align:center;font-size:1.5em}p{font-size:1.2em}</style></head><body><br><br><br><h1>How To Make A Screenshot</h1><p>text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article</p><p>More text.</p></body></html>

Inline style:

<!DOCTYPE html><html><head><title>How To Make a Screenshot</title><head><body style="background-color:#ffffff;background-image:url('http://forum.inkscapecommunity.com/tp-images/img/a-art2.png');background-repeat:no-repeat;background-position:center top;font-size:100%;font-family:Verdana,Geneva,sans-serif;margin-right:20%;margin-left:20%;"><br><br><h1 style="font-size:1.5em;text-align:center;">How To Make a Screenshot</h1><p style="font-size:1.2em;text-align:left;">text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article, text of article</p><p style="font-size:1.2em;">More text.</p></body></html>

EditPS - I understand if you can't answer this. I can try posting in the Tiny Portal forum, if you all can't help Thanks :)

Edited by brynn
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...