Jump to content

function problem with CSS :(...


rootKID

Recommended Posts

Hello W3S... what im trying to do here is to call a function that have some div's in it...and here is my code im using for this:

<center><div id="content_body"><center><!--/**********************/--><div class="content_left"><?phpecho full_width_auto_begin_box("Latest News");include ("mods_content/index/news.php");echo full_width_auto_end_box();?></div><!--/**********************/--><div class="content_right"><?phpecho full_width_auto_begin_box("Stats");include ("mods_content/index/stats.php");echo full_width_auto_end_box();?></div><!--/**********************/--></center></div><div class="clear"></div></center>

and as you see, then i also added a div class called clear at the end... but it still is confucing somehow... so here is my functions code below:

/*Inner (Box auto_100%) Mod Function*/function full_width_auto_begin_box($caption = ""){$begin = "<div class='100_auto_box_background'><div class='100_auto_box_title'><b>".$caption."</b></div><div class='100_auto_box_content'>";return $begin;}function full_width_auto_end_box(){$end = "</div><div class='100_auto_box_footer'><a href=''>To Top</a></div></div>";return $end;}/*Inner (Box auto_100%) Mod Function*/

and below here is my .CSS...:

/*CLASSES*/.clear {clear:both; /*SKAL HAVE EN START/###### DIV MED CLASS CLEAR FOR AT FOOTEREN IKKE IRITERRE FLOATSNE...*/}/*CLASSES*//*BOX auto_100% CSS*/.100_auto_box_background {width:100%;background-color: #808080;text-align:left;}.100_auto_box_title {width:auto;background-color: #616161;background-image:url(images/backgrounds/tables_titles/black_1.png);background-size:contain;text-align:left;font-size:20px;}.100_auto_box_content {padding:10px;width:auto;height:auto;background-color: #808080;text-align:left;}.100_auto_box_footer {width:auto;background-color: #616161;background-image:url(images/backgrounds/tables_titles/black_1.png);background-size:contain;text-align:center;}/*FOR THE LINK DECORATION IN THE BOX FOOTER...*/.100_auto_box_footer a:link { /*unvisited Links*/color:#990000;text-decoration:underline;}.100_auto_box_footer a:visited { /*Visited Links*/color:#990000;text-decoration:underline;}.100_auto_box_footer a:hover { /*mouse over link*/color:#990000;text-decoration:underline;}.100_auto_box_footer a:active { /*selected link*/color:#000000;}/*FOR THE LINK DECORATION IN THE BOX FOOTER...*//*FOR THE LINK DECORATION IN THE BOX CONTENT...*/.100_auto_box_content a:link { /*unvisited Links*/color:#900;/*background-color:#333333;*/border: 1px solid #990000;}.100_auto_box_content a:visited { /*Visited Links*/color:#900;}.100_auto_box_content a:hover { /*mouse over link*/color:#900;background-color:#333333;}.100_auto_box_content a:active { /*selected link*/color:#900;}/*FOR THE LINK DECORATION IN THE BOX CONTENT...*//*BOX auto_100% CSS*/

hoping someone can help me :/... Note that this is when im trying to make 2 things between each other... but when im putting it right under each item like so below:

<center><div id="content_body"><center><!--/**********************/--><?phpecho begin_box("Latest News");include ("mods_content/index/news.php");echo end_box();echo "<br />";echo begin_box("Stats");include ("mods_content/index/stats.php");echo end_box();?><!--/**********************/--></center></div></center>

and that is without a clear/both...ideas?...

Link to comment
Share on other sites

no ideas yet?...

Link to comment
Share on other sites

more importantly, what is the generated output in the browser? Have you viewed the source to make sure it looks right? Have you validated it make sure all your tags are closed and correctly nested? also, I know id's can't start with numbers, so there's probably a good chance classes can't either.

Edited by thescientist
Link to comment
Share on other sites

sorry for late reply... but i will check the possibility of the id's... maybe your actually right about that part... so will try change that later when home... ->From Cell-phone...

Link to comment
Share on other sites

hello tst...sorry for late reply as useal... ive been sick lately... anyways... did try as you said with the following of below... and it kinda almost worked :)... (PICTURE ATTACHED)... now my question is, how can i add the background to full again?... and why are the boxes so small?... i've setted them to 100% in the .CSS file... :/...ideas would be awsome... thanks... :)...

Link to comment
Share on other sites

it's really hard to tell with just a picture. Ideally a live link is the best way for people to help, so that they can view it right in the browser and use various debugging tools on it.

Link to comment
Share on other sites

so it looks like you didn't take my advice and look at the source of your own code, or validate it? I see quite a few validation errors coming from tags being unclosed. I would start with fixing your page first so we can get only the relevant issue at hand in the most stable context.

Link to comment
Share on other sites

sorry for late reply, and will do right away... and just so i can look a little more stupid... how do you check it?... with some sort of tool addon to browser orr?, and witch one?... might be handy for myself in the future... thanks in advance... PS: will be looking into the boxes right away to see if i can find the problem myself and post back,... :).. EDIT:... just for clearing... there are no errors at all at the index.php file... ive looked like ###### and can't locate the div (unclosed) one... so could you give me a clue?... like witch one i should look for?... and somfthing like that?... thanks in advance... PS: yeah... maybe this is basic stuff... but my eyes sometimes stink like ######... so... thanks in advance dude...

Edited by rootKID
Link to comment
Share on other sites

more importantly, what is the generated output in the browser? Have you viewed the source to make sure it looks right?
what I am talking about is the HTML the browser see's when PHP outputs whatever you tell it to. (i.e. view source)http://validator.w3.org/
Link to comment
Share on other sites

i still dont understand... i mean, i just view the source code, and i cannot find the error still... it seems like its still going to output the boxes the right places and closing them again...

Link to comment
Share on other sites

dude, you need to put 1 + 1 together. take your source code and VALIDATE IT. Then you will find quite a few issues. Fix those, then we can get back to fixing a page that isn't "broken".

Edited by thescientist
Link to comment
Share on other sites

ok, will do tomorrow, and then return with what ive fixed. and then you will be needing to tell me what more i need,sorry if im going to far... im still a learner.. :). Anyways... see ya tomorrow night orr so.. Regards: rootKID Writed by cellphone... EDIT: hello again... on monday, im going to school again... so i will be showing my teacher the stuff there... and then ask him... maybe he can help me find the errors your talking about :)... and then post feedback monday... sorry for late reply :)...

Edited by rootKID
Link to comment
Share on other sites

hello tst...lol... i tried to move the clear both div one up to the just end of the content div... and then i got the background to work... but now i have a problem with the boxes... when i try to set the boxes to 100% (Both of them), and they both have a div-box from themselves... should they not go out in full then?...

Link to comment
Share on other sites

is this same page we were talking about? do you have more than just a picture if not? Code? Link?

Link to comment
Share on other sites

sorry... my bad... still a little sick... anyways... yes.. same page... here are the Files: (ATTACHED)... Hope this helps... :).

Link to comment
Share on other sites

lol... so stupid as i am... i founded the problem with a little help from my teacher.. it was the .CSS file i needed to touch a little with... the div box i have included the functions to was on auto with the width... so the tables are working 100%... the problem was the div since it was on auto, then it did go as far as it could... so that is fixed now.... but thanks for inputs... and yeah, will still be looking for errors with the site you gave me... thanks for that! :)... Website: www.speed-scene.com/personal_sites/dark :).

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...