• Questions That Don't Need Their Own Thread v3
    4,068 replies, posted
  • Avatar of xmariusx
  • If u still only wants one box with a set width and the other div fill the rest of the site, as ur question was in the start: [code] <div style="width:200px;float:left;>1</div> <div>2</div> [/code] but adding a third div will make it on a second row. even with margin-right:200px; it just makes a white space over it.
  • Avatar of Miljaker
  • Why is using tables for layout bad? I know it's bad and I try to avoid it but never actually asked why. It seems so much easier to just make 3 <td> instead of messing around with absolute positioning...
  • [QUOTE=Miljaker;35098789]Why is using tables for layout bad? I know it's bad and I try to avoid it but never actually asked why. It seems so much easier to just make 3 <td> instead of messing around with absolute positioning...[/QUOTE] Tables are for tabular data. They represent data, not display. The whole reason people avoid using them for positioning any more is; 1) They are a cunt to work with if you need to change something 2) Semantics say that they should only ever hold data, not actual content.
  • [QUOTE=jung3o;35099611]Forums use tables :eng101:[/QUOTE] They don't have to though :eng101: To be honest, if you know the content isn't going to change constantly, or can generate content in a decent way, tables can work, and will cause less of a pain than CSS for positioning, even if they aren't a great idea really.
  • Avatar of swift and shift
  • [QUOTE=hexpunK;35099648]They don't have to though :eng101: To be honest, if you know the content isn't going to change constantly, or can generate content in a decent way, tables can work, and will cause less of a pain than CSS for positioning, even if they aren't a great idea really.[/QUOTE] tables are a huge pain in the ass to position with
  • [QUOTE=swift and shift;35100289]tables are a huge pain in the ass to position with[/QUOTE] Depends what you're positioning I guess. For grid based layouts they wouldn't seem to bad. But then your site isn't going to look the greatest compared to something with a more natural and actually decent CSS layout.
  • Avatar of Spero78
  • @Miljaker Why dont you use geo-ip to determine the users location and convert times accordingly? Makes more sense than a settings
  • Avatar of wilki
  • I have inserted some HTML code into a MySQL database using PDO. It inserts but seems to add \ to it like this. [code]<option value=\"None\">None</option> <option value=\"ActionScript\">ActionScript</option> <option value=\"ASP\">ASP</option> <option value=\"Bash\">Bash</option> <option value=\"C\">C</option> <option value=\"C#\">C#</option> <option value=\"C++\">C++</option> <option value=\"CSS\">CSS</option> <option value=\"HTML\">HTML</option> <option value=\"Java\">Java</option> <option value=\"JS\">JavaScript</option> <option value=\"jQuery\">jQuery</option> <option value=\"Lua\">Lua</option> <option value=\"MySQL\">MySQL</option> <option value=\"ObjC\">Objective C</option> <option value=\"Pascal\">Pascal</option> <option value=\"Perl\">Perl</option> <option value=\"PHP\">PHP</option> <option value=\"Python\">Python</option> <option value=\"Rails\">Rails</option> <option value=\"Ruby\">Ruby</option> <option value=\"SQL\">SQL</option> <option value=\"VBNET\">VB.NET</option>[/code] I aren't double escaping or anything so why is it putting in the \ in my code. This is how I am inserting the code. [code] $sql = "INSERT INTO `samwilki_cmash`.`posts` (`id`, `date`, `username`, `title`, `content`, `tag`) VALUES (NULL, CURRENT_TIMESTAMP, :username , :title, :content, :tag)"; $q = $con->prepare($sql); $q->execute( array('username' => $username, 'title' => $title, 'content' => $content, 'tag' => $tag) ); [/code] Can anyone help?
  • Avatar of KmartSqrl
  • [QUOTE=TehWhale;35098972]you don't need absolute positioning, if you do, you're doing it wrong[/QUOTE] If you use it right it makes certain things a lot easier to do. The trick is to keep your absolutely positioned elements inside something with position relative so they are only absolutely positioned within their parent and not the whole page.
  • Avatar of Richy19
  • Im trying to use JQuery UI to have a date picker on an input in a form bbut I cant get it to work. I have the following. [code]<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" /> <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script> <script type="text/javascript"> $('#datepicker').datepicker({ inline: false, changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd" }); </script> .......... <form method="post" action="#" enctype="multipart/form-data"> <p> <label>Date: </label><input name="date" id="datepicker" /><br /> <label>Content: </label><br /> <textarea name="content" rows="2" cols="50"></textarea><br /> <label for="file">Filename: </label><input type="file" name="file" id="file" /> <br /> <input name="submit" type="submit" value="Submit" /> </p> </form> [/code]
  • Avatar of rookwood101
  • [QUOTE=Richy19;35112134]Im trying to use JQuery UI to have a date picker on an input in a form bbut I cant get it to work. I have the following. [code]<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" /> <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script> <script type="text/javascript"> $('#datepicker').datepicker({ inline: false, changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd" }); </script> .......... <form method="post" action="#" enctype="multipart/form-data"> <p> <label>Date: </label><input name="date" id="datepicker" /><br /> <label>Content: </label><br /> <textarea name="content" rows="2" cols="50"></textarea><br /> <label for="file">Filename: </label><input type="file" name="file" id="file" /> <br /> <input name="submit" type="submit" value="Submit" /> </p> </form> [/code][/QUOTE] I think you need to set the input type to text.
  • Avatar of antid2
  • trying to learn rails with the rails zombies course..can someone tell me what i'm doing wrong here? [IMG]http://s16.postimage.org/qxtn4zn39/Screen_Shot_2012_03_12_at_6_48_37_PM.png[/IMG]
  • Avatar of Ac!dL3ak
  • [QUOTE=antid2;35113268]trying to learn rails with the rails zombies course..can someone tell me what i'm doing wrong here? [IMG]http://s16.postimage.org/qxtn4zn39/Screen_Shot_2012_03_12_at_6_48_37_PM.png[/IMG][/QUOTE] i'm not entirely sure you have a class named Tweet, check my work on that
  • Avatar of antid2
  • [QUOTE=Ac!dL3ak;35113411]i'm not entirely sure you have a class named Tweet, check my work on that[/QUOTE] these courses are supposed to automatically create the classes etc, where you can just use them to learn. So i'm not sure what i'm doing wrong here edit: if anyone is interested, i figured it out. [code] <% zombies = Zombie.all %> <ul> <% zombies.each do |zombie| %> <li> <%= zombie.name %> <% if zombie.tweets.count > 1%> <em> SMART ZOMBIE </em> <% end %> </li> <% end %> </ul> [/code]
  • Avatar of jung3o
  • [QUOTE=antid2;35113268]trying to learn rails with the rails zombies course..can someone tell me what i'm doing wrong here? [IMG]http://s16.postimage.org/qxtn4zn39/Screen_Shot_2012_03_12_at_6_48_37_PM.png[/IMG][/QUOTE] I think it's zombie.tweet.size > 1 or zombie.tweets.size > 1
  • Avatar of Richy19
  • Im trying to fill the top bit of this element but I cant get it to fill all the width, also the top and bottom padding doesnt work but the side does. [IMG]http://i.imgur.com/kui0Q.png[/IMG] This is the HTML [html] <div class="event"> <span class="date">On the: 12 Mar, 2012</span><br /> <div class="content">Hi<span class="hide">6</span></div> </div> [/html] And the CSS: [css] @charset "UTF-8"; .event{ border: 1px solid blue; margin: 2em; border-radius: 15px; width: 600px; } .event .hide{ visibility:hidden; } .event .date{ border-radius: 15px 15px 0px 0px; padding: 5px 15px; background-color: #DDD; width: 100%; position: relative; } .event .content{ border-top: 1px solid blue; } [/css]
  • Is there any reason for the date element to be <span>? <div> will stretch to fit perfectly fine. The padding does seem to be working too. You just have to adjust as the padding doesn't constrain to any size limits you put on the elements for some reason. [editline]13th March 2012[/editline] [code] <div class="event"> <div class="date">On the: 12 Mar, 2012</div> <div class="content">Hi<span class="hide">6</span></div> </div> [/code] [code] .event{ border: 1px solid blue; margin: 2em; border-radius: 15px; width: 600px; } .event .hide{ visibility:hidden; } .event .date{ border-radius: 15px 15px 0px 0px; padding: 5px 15px; background-color: #DDD; position: relative; } .event .content{ border-top: 1px solid blue; } [/code] Seems to give the result you were trying to get in Firefox. [img]http://dl.dropbox.com/u/6003122/ZScreen/Screenshot-2012-03-13_01.39.24.png[/img]
  • Avatar of Richy19
  • [QUOTE=hexpunK;35115240]Is there any reason for the date element to be <span>? <div> will stretch to fit perfectly fine. The padding does seem to be working too. You just have to adjust as the padding doesn't constrain to any size limits you put on the elements for some reason.[/QUOTE] Yea I made the date element a div and it magically worked fine :D this is the result [url]http://facepunch.com/threads/1152034?p=35115273&viewfull=1#post35115273[/url]
  • [QUOTE=Richy19;35115280]Yea I made the date element a div and it magically worked fine :D this is the result [url]http://facepunch.com/threads/1152034?p=35115273&viewfull=1#post35115273[/url][/QUOTE] Much better :v:
  • Avatar of swift and shift
  • [QUOTE=antid2;35113268]trying to learn rails with the rails zombies course..can someone tell me what i'm doing wrong here? [IMG]http://s16.postimage.org/qxtn4zn39/Screen_Shot_2012_03_12_at_6_48_37_PM.png[/IMG][/QUOTE] in ruby we use == for equality testing, not =
  • Avatar of Jelly
  • [QUOTE=swift and shift;35118019]in ruby we use == for equality testing, not =[/QUOTE] Pretty sure == and = mean the same in nearly all languages.
  • Avatar of hacksore
  • I can't seem to get [url=https://github.com/kemayo/sublime-text-2-git]this[/url] package working. Is this just me that has the issue? I've tried installing it via the package installer and by cloning the git repo. None of the methods were successful in giving me the git integration I'm looking for. So if you are one that uses this package flawlessly could you shed some light on installing it correctly.
  • Avatar of Jelly
  • [QUOTE=swift and shift;35118054]vb[/QUOTE] [QUOTE=Jelly;35118049]Pretty sure == and = mean the same in [b]nearly[/b] all languages.[/QUOTE]
  • Avatar of Dragory
  • [QUOTE=Jelly;35118049]Pretty sure == and = mean the same in nearly all languages.[/QUOTE] Pretty sure == and = don't mean the same in nearly any language. Or at least from what I've tried. In VB they might (but then again, I haven't used VB).
  • Avatar of swift and shift
  • [QUOTE=Dragory;35119478]Pretty sure == and = don't mean the same in nearly any language. Or at least from what I've tried. In VB they might (but then again, I haven't used VB).[/QUOTE] i think he means '==' means the same as the '==' in nearly any other language
  • Avatar of Doritos_Man
  • My Dad would like me to create a website for his construction business. I already have hosting and a domain but where should I start? Should I start by sketching up a simple website or should I get a CMS of some sort? It's going to mostly be static material.