PHP - Css Float Issues In Fluid Layout
first person to solve this gets an automatic, irrevocable entry into my VIP Holiday Card Master List. ive been tussling with it for hours over two days and cannot figure out what the problem is.
site: http://104.152.168.18/~redtagsp/
you'll see five image buttons in the center of the homepage. red bg is for diagnostic only. the third of the smaller images in the top row is sitting slightly lower than the others. the containing element (transparent black) is floated as are all 5 images within it. and the text-div above the images. seems really simple but ive had these frigging elements bobbing all around and this is the best i can get them. my guess is there is some CSS outside of my own (this is a Wordpress site) that is screwing things up for me but i cant find it.
here is the HTML for the containing element:
<div id='home_buttons'> <div id='free_shipping'><strong>FREE</strong> Shipping on all orders over $40</div> <a href=''><img src='/~redtagsp/wp-content/themes/bmw_storefront_child/pics/buttons/button_blank_pucks.png' class='home_button_small'></a> <a href=''><img src='/~redtagsp/wp-content/themes/bmw_storefront_child/pics/buttons/button_custom_pucks.png' class='home_button_small'></a> <a href=''><img src='/~redtagsp/wp-content/themes/bmw_storefront_child/pics/buttons/button_custom_pucks.png' class='home_button_small'></a> <div style='float:left; clear:both; width:100%; height:5px;'></div> <a href='' class='link_button_large'><img src='/~redtagsp/wp-content/themes/bmw_storefront_child/pics/buttons/tape.png' class='home_button_large'></a> <a href='' class='link_button_large'><img src='/~redtagsp/wp-content/themes/bmw_storefront_child/pics/buttons/balls.png' class='home_button_large'></a> </div>here is the CSS directly associated with the above: #home_buttons { float:left; width:95.4%; padding:1%; margin:100px 1% 20px 1%; background:rgba(0, 1, 17, 0.75); border-radius:10px; } #free_shipping { float:left; width:100%; text-align:center; border-radius:5px; background:#555; color:#fff; margin-bottom:10px; } #home_buttons a { float:left !important; max-width:32.8%; margin:0 0.5% 0 0; padding:0px !important; background:red; clear:none !important; } .link_button_large { float:left !important; max-width:49% !important; margin:0px 2% 0px 0px; clear:none; } .link_button_large:last-of-type { margin:0px; } .home_button_small { float:left; max-width:100%; } .home_button_small:last-of-type { margin-right:0%; } Similar TutorialsThis topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=312178.0 Can someone clear up my confusion about FLOAT. I have data in a TINYINT field that displays whole numbers WITHOUT any decimal places. This does not format very nicely when there are ALSO decimalled values to be echoed: 1 1.5 2 2.5, etc. It can be a little confusing. The only way I've thought of to resolve the issue (if you know another, please share) is to add a decimal place to get: 1.0 1.5 2.0 2.5 etc. But I am unclear on WHERE to put the commands to get this result. Does it go into the actual DB? Or into my PHP script? Please help with a detailed example. Thanks The following returns strings instead of floats. Am I able to retrieve floats directly from PDO and/or PostgreSQL or must I manually type cast them afterwards using PHP? Thanks $sql='WITH RECURSIVE t AS (bla bla bla) SELECT id, CAST(SUM(slope*value+intercept) AS FLOAT) "value", SUM(slope*prev_value+intercept)::FLOAT "prevValue" FROM t WHERE type=\'physical\' GROUP BY id'; $stmt = $this->pdo->prepare($sql); $stmt->execute($ids); $arr = $stmt->fetchAll(\PDO::FETCH_UNIQUE); //returns [123=>['value'=>'123.456', 'prevValue'=>'122.234'], ...]
Hello, The data that actually gets stored in my database differs from what I'm trying to put there. Here's a short code snippet: $lat = 42.272939; $lng = -83.622941; // insert cordinates into dB $query = "INSERT INTO markers (lat, lng, user_id) VALUES ('$lat','$lng','$user_id')"; $results = mysql_query($query) or die(mysql_error()); When I look in the database, the data is stored as: 42.272938 and -83.622940. Any ideas as to why this happens? These values are being stored as float(10,6). Not sure if this is useful, but here's some other info: datbase: MySQL engine: InnoDB Format: Compact Collation: utf8_general_ci Thanks im trying to update a GPS table for example: UPDATE markers SET lat = '38.40907441955112' AND lng = '14.943452775478363' WHERE ApID = '35911' i tried with float 20,18 it isnt updatng correctly Hi, in Mysql have a row with FLOAT 10,2 In form put the number 20.20 and after reload in form show: 20.200000762939 I know I may sound like a nab, but here I go: Code: [Select] $ric=10; $price=$price+($price/$ric); Basically I want to add a 10% to the price value this is inside a "for", and price values is taken from a csv file. Said value is for example: $price=4,36 after the script takes place, the value goes to: $price=4796 While i aimed to obtain 4,80 (a 2 precision float). Can anyone help me? It's the first time I mess with float numbers. EDIT: Or at least direct me to a more efficient way to apply % on doubles, while preserving the original precision Hey all, I can not get utf-8 working properly. I'm having issues with special characters, such as bullets, e with an accent over it, etc. The data is being stored in my mssql database properly, and I can see everything there fine. It's when I grab it from the database and display it on my php page. The page it set up to utf-8, if I go to Tools>Page Info, it says encoding is utf-8. I have it in my headers, I just can not figure out why it will not display on the page. Any thoughts? Issue # 1 How can i send the values come from $_POST['name'],$_POST['number'] to an email address xyz@radiations3.com??? Issue # 2 I am trying to display data from four different tables with the following sql query: (The problem is that the data is getting displayed fine but i don't know why some of the (same )data gets repeated two or three times where as i checked in all four tables and all the data exists one time not twice) If anything wrong with my query kindly help SELECT distinct * FROM applicant,applicant_info_nic,room,student WHERE applicant_info_nic.status='Available' and applicant.appNIC=applicant_info_nic.appNIC and applicant.roomID=room.roomID and applicant.appNIC=student.appNIC ORDER BY applicant.roomID i am trying to sort out a session now, i normally use the folllowing code to check if someone is logged in and if they are not to forward them to the login page, but i am getting this message: Notice: Undefined index: username in code: Code: [Select] if ($_SESSION['username']) { }else{ include 'login.php'; die(""); } can someone help please. Hello, I'm having troubles parsing text properly. Whenever I submit data into a mysql db, and then call that specific data, in the text, I get this symbol, �. Does anybody know what it is or how to remove it? I believe it's with utf-8 and me using a function that corrupts the string but I'm not sure. Anybody have any clues? Thanks in advance. Hi, my name is Michael Vallier and I am the director of Killer Film Fest. This year I have incorporated some new features and need some php help. If you are able to help with either or both problems, please let me know. Thanks in advance. 1. I am using a forum and I need help customizing it. I have no idea what I am doing. I have changed a few things, but don't know enough to do what I want. I don't need anything crazy, just to fit the look of our website. The forum is not open yet but you can see it he http://www.killerfilmfest.com/forum/ 2. I found a add-on to my website which is a file manager. People can create an account and upload files to my FTP server. I want to use this for filmmakers to upload their films if they choose to do it this way. There is a 10mb limit and it is possible to make it unlimited. I contacted the creator of the application and he led me to a wiki page with the directions. It looked real simple and I tried to do this but without any luck. So if there is anyone out there who can help, that would be great. Thanks -Michael Vallier- Hey I'm having issues with using strtotime(), date(), and time(). I have a couple problems. The first is: I used strtotime to get the unix of a specific date and time (worked great, even outputted the correct time using date() to return it). However when I went to post information on it (I set it up so that you can't post after the event started), it told me it already started like an hour before it was supposed to. I used Code: [Select] if (time() > $event['when']) { echo "too late."; } else { do it } to determine. That had me very confused. Then I decided instead of manually inputting the event times I would pull them from an xml file, which I had no trouble reading. I used: Code: [Select] strtotime("Next $day, $time PM") with $day = Sun, $time = 1:00- This outputted a unix timestamp but then date() returned it as being 7 pm on sunday instead. Any ideas what would be causing these strange things? Hi, I'm trying to convert a charting app to OOP. So here I've simplified it down to just the bare bones issue of drawing a line to a png image and displaying it. Code: [Select] <?php class chart { var $im; var $backgroundColor; var $textColor; function chart() { $this->im= @ImageCreate (100, 200) or die ("Cannot Initialize new GD image stream"); $this->backgroundColor = ImageColorAllocate ($this->im, 224, 234, 234); $this->textColor = ImageColorAllocate($this->im, 233, 14, 91); } function display() { imageline ($this->im,0,0,100,200,$this->backgroundColor); imageline ($this->im,100,0,0,200,$this->textColor); ImagePng ($this->im); } } ?> Here is the code which instantiates the class. Code: [Select] <?php include "simple_draw.php"; $mychart = new chart(); $mychart->chart(); $mychart->display(); ?> Basically depending on how I rework it, one of two things happens: a)it generates a bunch of little boxes which say fffd, or b) I get a message saying the resource is invalid or nonexistent (this error isn't coming up right now so I can't be precise.) If this is run outside the OOP environment it works fine. No sure. I'm really trying to work with classes but this kind of problem is frustrating and admittedly makes it tempting to just go back to regular functions. Any ideas?? Thanks, Jeff I have this code that i tried running it on my phpmyadmin it works fine ,but when i use it on my php code to query its not working.What could be the issue? SELECT * FROM `roombook` ORDER BY (CASE stat WHEN 'Checked in' THEN 1 WHEN 'Booked' THEN 2 WHEN 'Deposit Confirmation' THEN 3 WHEN 'Email/phone' THEN 4 WHEN 'Checked Out' THEN 5 ELSE 'Cancelled' END) ASC, stat ASC
As far as it goes for me I have the switch() working, but not to what im trying to do. This is for a "media" page where I have 3 different categories "Music", "Videos" and "Photos". I'm trying to get it so when you goto the "Media" page it will show just the 3 categories, that section works but it is also showing the sub categories for all them categories. So for what im trying to do is when viewing the "media" page, it will display the 3 categories, then when selecting the category it will display the "sub categories". and then when you select the "sub category" it will display the contents of that "sub category" should i be trying to do this a different way? or do i have something wrong here? lol here is my switch() code Code: [Select] <?php $cat = (isset($_GET["m_cat"])) ? (intval($_GET["m_cat"])) : 0; switch($_GET["b"]=="true") { default : if("/ffy/media.php"==$_SERVER['PHP_SELF']) { echo "Select a Category"; } case "false": if($_GET["m_cat"]==$cat) { echo "<font size='3'>"; $dcat = mysql_query("SELECT * FROM media_sub_cat WHERE m_cat=$cat") or die("mySQL Query Failed: " .mysql_error()); while($catrow = mysql_fetch_array($dcat)) { list($id, $m_sub_cat, $m_cat) = $catrow; echo ": <font class='myFont'><a href='media.php?b=true&cat=".$m_cat."&subcat=".$m_sub_cat."'>".$m_sub_cat."</a></font> "; } echo ":</font>"; echo "Work Damb You"; } break; case "true": if($_GET["cat"]==$cat && $_GET["subcat"]==$m_sub_cat) { echo "Weird..."; } break; } ?> i have two pages form and submit page index.php Code: [Select] <?php error_reporting(E_ALL); $bauturi = array('bauturi_alcoolice'=>'Bauturi alcoolice','sucuri'=>'Sucuri','bauturi_racoritoare'=>'Bauturi racoritoare'); echo '<form action="post.php" method="post">'; echo'<select name="bauturi">'; foreach($bauturi as $let=>$word){ echo'<option value="'.$let.'">'.$word.'</option>'; } echo'</select>'; echo '<INPUT type="submit" value="show me money"> </form>'; ?> post.php Code: [Select] <?php error_reporting(E_ALL); $drop = $_REQUEST['bauturi']; echo $drop; ?>if i select Bauturi alcoolice on post.php page i get bauturi_alcoolice but i want to get Bauturi alcoolice as result i tried to use foreach like this Code: [Select] <?php error_reporting(E_ALL); $drop = $_REQUEST['bauturi']; $bauturi = array('bauturi_alcoolice'=>'Bauturi alcoolice','sucuri'=>'Sucuri','bauturi_racoritoare'=>'Bauturi racoritoare'); foreach($bauturi as $drop=>$word){ echo $word; echo "<br/>"; unset($word); } ?> but i get all the values in the form i only want to show the selected value from the form in post.php page thanks in advance This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=327118.0 Hi Guys, Beginner needs help with accommodation search feature...i have two drop downs(area and type), each one has an 'any' option. I cant evalute the 'any' options directly against the database so have written this: Code: [Select] <?php //query database if ($_SESSION['type']== 'any' && $_SESSION['area']== 'any'){ $query = mysql_query("SELECT * FROM hotels Order by RAND() "); } elseif ($_SESSION['area'] == 'any' && $_SESSION['type'] != 'any'){ $query = mysql_query("SELECT * FROM hotels WHERE type = $_SESSION[type] Order by RAND()"); } elseif ($_SESSION['type'] == 'any' && $_SESSION['area'] != 'any'){ $query = mysql_query("SELECT * FROM hotels WHERE location =$_SESSION[area] Order by RAND()"); } else{ $query = mysql_query("SELECT * FROM hotels WHERE location ='$_SESSION[area]' AND type ='$_SESSION[type]' Order by RAND()"); } //show results while ($search_result = mysql_fetch_assoc($query)) { echo '<b>'.$search_result[name] . '</b><br>'; echo '<p><img src="'.$search_result['photo1'].'" /></p>'; echo '<p><img src="'.$search_result['award'].'" /></p>'; echo $search_result[description] . '<br><br>'; }?> The first if and last else return the correct info from database but the middle two elseif's throw this error: Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given.... I have commented out the queries and replaced them with simple echoes and they all seem to evaluate correctly!. So im lost why $query isnt assigned in the middle two elseif's ?? Any ideas what im doing wrong and is there a better way. Cheers!! Now I am getting: Use of undefined constant - assumed 'cust_no' in C:\wamp\www\flow\query\111.php on line 25 Use of undefined constant office - assumed 'office' in C:\wamp\www\flow\query\111.php on line 26 Use of undefined constant fname - assumed 'fname' in C:\wamp\www\flow\query\111.php on line 30 Use of undefined constant lname - assumed 'lname' in C:\wamp\www\flow\query\111.php on line 31 In the browser when I go to this file....what am I missing? Please see my simple code....basically, I'm just trying to pull data from a MySQL database to view in a browser & I think I am either missinh a " or ' or need to add one somewhere......thanks Code: [Select] <html <head> <?php require('connection.php'); if (isset($_GET['op']) && $_GET['op'] == "d") if($_GET['op'] == "d" && !empty($_GET['id']) ) { $result = mysql_query($query) or die(mysql_error()); } $query="SELECT fid, cust_no, fname, lname, office FROM psrinfo"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array( $result )) { ?> <?php } echo '<form action="111.php" method="post"> <table width="75%" border="1"> <tr> <td><b>Customer No:</b> <br><input type="text" name="cust_no" size="25" maxlength="30" value="'. $row[cust_no] .'" /><br> </td> <td><b>Office:</b> <br><input type="text" name="office" size="25" maxlength="30" value="'. $row[office] .'" /><br> </td> </tr> <tr> <td><b>Customer First Name:</b> <br><input type="text" name="fname" size="25" maxlength="30" value="'. $row[fname] .'" /><br> </td> <td><b>Customer Last Name:</b> <br><input type="text" name="lname" size="25" maxlength="30" value="'. $row[lname] .'" /><br> </td> </tr> </table> </form>'; mysql_close(); // Close the database connection. ?> </tbody> </table> |