subhomoy Posted October 25, 2012 Share Posted October 25, 2012 I got a script from somewhere on google and found that it contains a "dynamic div" tag i.e see below <div id="ad<?php echo $fn; ?>"> // [color=#ff0000]This is the place where i'm facing problem...[/color] <a href="index.php?tp=visit_task&t=<?php echo $fn; ?>&id=<?php echo $fn; ?>" target='_blank' onclick='hideDivTag("ad<?php echo $fn; ?>");'><?php echo $fsitename; ?></a> ( You earn: <?php if($fpaytype=='points') { ?><?php echo $prise; ?> <?php echo $setupinfo['pointsName']; ?>(s)<?php } else if($fpaytype=='usd') echo $setupinfo['currency']."$prise"; ?> ) <BR /><BR /></div><?php $clicks++; } } } ?><br /> </div> when this code is seen in browser it looks like this <div id="ad44"> <a href="index.php?tp=visit_task&t=44&id=44" target='_blank' onclick='hideDivTag("ad44");'>Google</a> ( You earn: Rs 0.001000 ) <BR /><BR /></div> <div id="ad45"> // [color=#ff0000]This One[/color] <a href="index.php?tp=visit_task&t=45&id=45" target='_blank' onclick='hideDivTag("ad45");'>156</a> ( You earn: Rs 0.001000 ) <BR /><BR /></div> <div id="ad47">// [color=#ff0000]This One[/color] <a href="index.php?tp=visit_task&t=47&id=47" target='_blank' onclick='hideDivTag("ad47");'>123</a> ( You earn: Rs 0.001000 ) <BR /><BR /></div> <div id="ad49"> //[color=#ff0000]This One[/color] <a href="index.php?tp=visit_task&t=49&id=49" target='_blank' onclick='hideDivTag("ad49");'>789</a> ( You earn: Rs 0.001000 ) <BR /><BR /></div> <div id="ad50"> //[color=#ff0000]This One[/color] <a href="index.php?tp=visit_task&t=50&id=50" target='_blank' onclick='hideDivTag("ad50");'>459</a> ( You earn: Rs 0.001000 ) <BR /><BR /></div><br /> <br /> </div> see that every div tags automatically assigns a number beside it.. I want to add new style of this div but can't do that as it is changing randomly whenever new ads is posted and i also can't find the #ad in the .css also..... can anyone help me.... Thanks in advance... Quote Link to comment https://forums.phpfreaks.com/topic/269888-can-anyone-help-me/ Share on other sites More sharing options...
Psycho Posted October 25, 2012 Share Posted October 25, 2012 Then don't use the ID to apply the style properties! Every element must have a unique ID. But, you can give many elements that same class. So, modify the code to apply a class to the divs then define the class in your CSS file. Quote Link to comment https://forums.phpfreaks.com/topic/269888-can-anyone-help-me/#findComment-1387616 Share on other sites More sharing options...
subhomoy Posted October 25, 2012 Author Share Posted October 25, 2012 Then don't use the ID to apply the style properties! Every element must have a unique ID. But, you can give many elements that same class. So, modify the code to apply a class to the divs then define the class in your CSS file. Can you plz give a bit of detail.... Thanks for the reply... Quote Link to comment https://forums.phpfreaks.com/topic/269888-can-anyone-help-me/#findComment-1387617 Share on other sites More sharing options...
subhomoy Posted October 25, 2012 Author Share Posted October 25, 2012 Anybody plz reply.... Quote Link to comment https://forums.phpfreaks.com/topic/269888-can-anyone-help-me/#findComment-1387685 Share on other sites More sharing options...
White_Lily Posted October 25, 2012 Share Posted October 25, 2012 If any jQuery or Javascript came with this stuff, then look there as both jQuery and Javascript can add style classes. Also - try be patient, people have lives. Quote Link to comment https://forums.phpfreaks.com/topic/269888-can-anyone-help-me/#findComment-1387687 Share on other sites More sharing options...
mikosiko Posted October 25, 2012 Share Posted October 25, 2012 (edited) Css 101.... wait... more basic than that http://bit.ly/TY1IM2 Edited October 25, 2012 by mikosiko Quote Link to comment https://forums.phpfreaks.com/topic/269888-can-anyone-help-me/#findComment-1387688 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.