PHP - How To Header Background Image Responsive
Hello
I am working on a site and the theme is a responsive theme but the header background is not resizing on mobile and tablets below is a link to the site
http://unitednews.sr/category/news/each category / page has a unique header , this is what I have in css for category news body.category-news #header-wrap { background: url( http://unitednews.sr/wp-content/uploads/2014/10/Header_UnitedNews.jpg); background-repeat:no-repeat; }Adding background size: cover does not work any idea ? Edited by crawling, 13 November 2014 - 11:47 AM. Similar TutorialsLittle topic that's gonna bug me if I don't ask
I'm trying to learn static layouts, and I'm just getting the hang of them. A few friends are telling me to go responsive to accommodate mobile/tablet users? I can see it from a business sites perspective where you want all types of users and with ease of access, but my site is going to be a gaming modification community, where mobile users aren't really the target audience as it's quicker and easier to download them on the PC than a Phone. I was going to accommodate that audience by allowing them very basic usage (chat, forums, account) and leave off the heavy parts like the gallery, and downloads.
Am I going in the wrong direction? Should I be heading down the responsive route? I've literally only just started the first page for the site, but it'd mean re-learning a whole bunch more new stuff which'd prolong the sites progress.
Just looking for a little advice in which direction to head
Hi,
I'm a newbie.
I am looking around for a responsive forum that I can install on my website that can handle lots of users and that I can customioze so that existing registered users are automatically added to it.
In other words I don't want users to register on my site and then have to register again for the forum.
I am at the beginning of the project, so i could work it so that users register into the forum software tables and I work on permissions from there.
Any ideas?
It must be responsive as the main bulk of users will be mobile user.
So sorry if this topic has already been covered
Thanks a mill in advance
Jay from Ireland
Greetings. I'm working on a Wordpress site utilizing a fully-responsive theme ( www.ailimconsulting.com ). One of the features that was requested was the integration of a special menu hover effect found at GitHub that creates a shadow below the menu item being moused over ( you can see this effect by visiting the link above ). As part of the fully responsive nature of the theme, when the browser collapses to a certain point or the site is viewed on mobile devices the menu itself collapses to a single-tabbed system. The problem is that the class that controls the shadow float causes this collapsed menu to look like crap. So, we want to remove the directives of this class from all the mobile viewing settings ( the @media controls ).
The effect is added to the menu via the Appearance / Menus in the CSS Classes field in each menu item with the class name of .float-shadow.
The effect works perfectly in full browser mode but needs t be removed from all the @media sections of the CSS that control the fully-responsive nature of the theme in various devices dimensions. For example, these are the @media directives:
/*-------------------[320px]------------------*/ Hello everybody, I created a function called 'imgCreate ()' to resize an image. I'm trying to use this function to recreate images in two sizes that I need from a base image received by upload. The question is, the two images are created from the base image that I keep in a folder 'uploads', the original image is saved correctly now two other file is created, but it only comes with zero bytes and the image does not appear, or is not properly created. Another thing also happened is that the images began to be displayed in binary. I tried to insert the header ("Content-type: image / jpeg) but still does not work. I've tried several ways to correct but still not had success, if someone can me better target for correction of these errors will be immensely grateful. Below is the code I'm using. Function 'imgCreate()' in file 'funcoes.php': <?php function imgCreate($imgjpg, $width_target) { $img = imagecreatefromjpeg($imgjpg); $width_origin = imagesx($img); $heigth_origin = imagesy($img); $heigth_new = (int)($heigth_origin * $width_target)/$width_origin; $new = imagecreatetruecolor($width_target,$heigth_new); $criado = imagecopyresampled($new, $img, 0, 0, 0, 0, $width_target, $heigth_new, $width_origin, $heigth_origin); if($criado){ header("Content-type: image/jpeg"); echo imagejpeg($new, $arquivo, 100); } else return "Not possible create image!"; } ?> Code where I'm trying to use the function: <?php require 'funcoes.php'; $photo = $_FILES["photo"]; if(isset($photo)) { $widthThumb = 117; $widthImage = 350; $newNamePhoto = uniqid(time()); $newPhoto = "../uploads/".$newNamePhoto; $newNameThumb = $newNameFoto."_thumb.jpg"; $newNameImage = $newNameFoto."_img.jpg"; move_uploaded_file($photo['tmp_name'], $newPhoto); $thumb = imgCreate($newFoto, $newPhoto, $widthThumb); $file = fopen("../uploads/".$newNameThumb,"wb"); fwrite($file, $thumb, sizeof($thumb)); fclose($file); $image = imgCreate($newFoto, $newPhoto, $widthImage); $file = fopen("../uploads/".$newNameImage,"wb"); fwrite($file, $image, sizeof($image)); fclose($file); } ?> Hi all, I am trying to send an image through header so I have two php files: test0.php Code: [Select] <html> <head> </head> <body> <?php $imagename='test.php'; ?> <img src="<?php echo $imagename; ?>"/> </body> </html> and test.php: Code: [Select] <html> <html> <head> </hesd> <body> <?php $image = imagecreatefromjpeg('images/1.jpg'); header('Content-Type: image/jpeg'); imagejpeg($image, '', 100); ?> </body> </html> but the image doesn't show . What is the correct way? Thank you in advance. Hi, I am trying to get my contact form from page into header. I have been at his for days now, I can get the contact form into the header with this <?php echo do_shortcode( '[contact-form 1 "Contact form 1"]' ); ?> but can not get it to sit centrally and in front of image.
This is my site, http://www.cloudchasing.co.uk/
The site style that I am trying to emulate is this one http://www.premierwi...screens.co.uk/
Pleeeease help a newcomer
hi evry bdy i m new to php here is my big problem im trying to display images and resize but header tag in php not working here is my code <?php header('Content-type: image/jpeg'); $new_width = 200; $new_height = 200; $files = glob("images/*.*"); //print_r($files); //for ($i=0; $i<count($files); $i++) { $filename= $files[0]; print $filename."<br />"; list($width, $height) = getimagesize($filename); echo "width is".$width." and height is ".$height; echo '<img src="'.$filename.'" alt="random image" />'."<br /><br />"; $image_p = imagecreatetruecolor($new_width, $new_height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); imagejpeg($image_p, null, 100); //} ?> if i m commenting header in line 3 then it is displaying garbage value if i m not commenting then it is displaying filename as string ... i wanna resize image please help me..... I have a page that displays various articles. I would like to show a background image for each article. Let's say I have articles for beaches. I would like to have a beach photo. Airplane article, show airplanes, etc. How can I accomplish this. This creates an image 1500x1500 pixels. But it creates it in black... how can i make it white. And i have to use imagecreatetruecolor() not imagecreate(). <?php $im = imagecreatetruecolor(1500,1500); // Output the image to the browser header('Content-type: image/jpg'); imagejpeg($im); imagedestroy($im); ?> Thanks! This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=319094.0 Hello everyone, I'm just starting out with PHP as I need to create an online bookstore for a school project. I'm working by a magazine which should teach you exactly how to do this using PHP, but I've had a bunch of problems with the code they use and I don't really know what's going on. Anyway, this looks really simple and basically what it does is allows you to post a comment on a book, then returns you to the book's page. Problem is, I'm getting the Header may not contain more than a single header, new line detected. error and I can't figure out why. I've tried researching into the matter but all the cases I found had to do with returning to an url, which is not my case. Anyway, here's the snippet of code: The form: Code: [Select] <div style="width:400px; border:1px solid #ffffff; background-color:#F9F1E7; padding:5px"> <b>Adauga opinia ta:</b> <hr size="1"> <form action="adauga_comentariu.php" method="POST"> Nume: <input type="text" name="nume_utilizator"><br><br> Email: <input type="text" name="adresa_email"><br><br> Comentariu: <br> <textarea name="comentariu" cols="45"></textarea><br><br> <input type="hidden" name="id_carte" value="<?=id_carte?>"> <center><input type="submit" value="Adauga"</center> </form> </div> The script adaugare_comentariu.php: Code: [Select] <?php ob_start(); include("conectare.php"); $numeFaraTags=strip_tags($_POST['nume_utilizator']); $emailFaraTags=strip_tags($_POST['adresa_email']); $comentariuFaraTags=strip_tags($_POST['comentariu']); $sql="insert into comentarii (id_carte, nume_utilizator, adresa_email, comentariu) values(".$_POST['id_carte'].", '".$numeFaraTags."','".$emailFaraTags."','".$comentariuFaraTags."')"; mysql_query($sql); $inapoi="carte.php?id_carte=".$_POST['id_carte']; header("location:urldecode($inapoi)"); ob_end_flush(); ?> conectare.php connects to the mysql database. $inapoi is the variable which returns the user to carte.php (the book he posted a comment on), where id_carte is the book's unique id. I'm getting Header may not contain more than a single header, new line detected on line ten, which is the header line. Can anyone help me? I've been stumped on this for a few days now and I've just let it pass and started working on other bits, but it's bugging me too much and I'd like to fix it. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=350027.0 This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=355565.0 Well here is the original code in my script file, and it has a background color Green now: [/php]$article_content = "<center><table style='color: #FFFF31; background: Green; width: 400px; border: 1px solid #9BDDFF;'><tr><td><i><b><u>Welcome to Mysidia City's fishing pool</b></u></i><br><br><br> Before you actually begin your fishing career, I'd strongly recommend you to doublecheck if you have a fishing rod already since it is apparently required for every fisherman here. <br><br><br><a href='fishing.php?act=1'>Enter</a> the fishing pool now if you have a fishing rod already or <br>Visit this <a href='fishingquiz.php'>Page</a> to take the fishing quiz and earn yourself an old rod to begin with. <td></tr></table><br><center><img src='picuploads/other/lakeofrage.png'></center>";[/php] Now I wish to replace the background color with a background image, what should I do? The image url is provided below: http://www.pokemansion.net/picuploads/other/seadrabg.png I was wondering if there is any way to let visitor chose image background of div and store it in session so every page have same background? This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=349151.0 I am using the following css
.content { min-height: 850px; color: #CCC; padding-right: 320px; background-image:url(../images/wheelie.png); background-repeat: no-repeat; background-position: right bottom; }however the background image only shows in the desktop version of safari, I have checked firefox and chrome and mobile safari. I can't see why. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=331191.0 Weird question. I am using a captcha class which creates the code/image simply by doing this: Code: [Select] <img src="captcha.php"> The captcha.php file has lots of code of course, but this being key to my question: Code: [Select] header("Content-Type: image/jpeg"); ImageJpeg($image); Can I do it so I can create the image in the PHP of the actual script executing, so I don't have to call captcha.php in the image? - So it would look like this: (well no, but I think this explains what I want) Code: [Select] <img src="<?php echo $captchaCreated; ?>"> I am using a MVC design and don't see why the captcha should try and change this. I am trying to copy an image into another image. Code: [Select] $im = imagecreatefrompng("/oldimg.png"); //this is a semi-transparent image where I want the new image to be copied imagealphablending($im, 1); //this seems to remove the black background header('Content-type: image/png'); //outputs old image with a transparent background (YAY!) imagepng($im); imagecopy($im, $newimage, 32, 0, 0, 0, 32, 32); //I want to replace a part of the old image with a new semi-transparent image header('Content-type: image/png'); //outputs image with a black background (noooooooooo!) imagepng($im); Can anyone help me? |