As making bottoms (Background) random in PHP and CSS

As making bottoms (Background) random in PHP and CSS

As making random bottoms in PHP and CSS

This trick consists of creating a Web where the users do not have to do always the same basic image in a Web. In order to achieve this objective it is necessary to follow the following steps.

In your index.php you do the following thing.

<style does type = " text/css? average = " screen " > <? php $imágenes = Array (“imagen1.jpg?, “imagen2.jpg?); $valor = rand (0, count ($imágenes) - 1); //Use of rand (): rand (minimal Value, Value maximum);
I throw “body \ {background: #000 URL (‘image/“. $imágenes [$valor]. ? ‘) no-repeat top right fixed; height: 100%; background-attachment: fixed; background-repeat: repeat; background-position: to center to center; background-size: cover version; - moz-background-size: cover version; - webkit-background-size: cover version; - o-background-size: cover version; }?; > </style>

Note: so that this works within a Style, php is necessary to place that fragment of code within The images must be in a single folder.

Complete example, is as well as it must be more or less.

<! DOCTYPE html> <html lang = " is " > <html > <head > <title >Corporativo Vera&reg; - Area of cliente</title> does <meta charset = " utf-8 " > <meta yam = " description? content = "" > <meta yam = " author? content = " @abimaelgtp " > <meta HTTP-equiv = " X-UA-Compatible? content = " IE-edge " > <meta yam = " viewport? content = " width=device-width, initial-scale=1 " > <style type = " text/css? average = " screen " > <? php $imágenes = Array (“imagen1.jpg?, “imagen2.jpg?); $valor = rand (0, count ($imágenes) - 1); //Use of rand (): rand (minimal Value, Value maximum); I throw “body \ {background: #000 URL (‘image/“. $imágenes [$valor]. ? ‘) no-repeat top right fixed;  height: 100%;  background-attachment: fixed;  background-repeat: repeat;  background-position: to center to center;  background-size: cover version;  - moz-background-size: cover version;  - webkit-background-size: cover version;  - o-background-size: cover version;  }?; > </style> </head> <body > <h1>Hola world, the random bottom already is due to show, to be seeing seeing the effects, presses F5</h1> </body> </html>

This code is made to give an idea more or less perhaps of how to make this type of activities, many tricks exist.

Abimael Gutierrez P.

Abimael Gutierrez P.
Founder of apdesc

Home style of facebook using HTML and CSS

As to create a design Web similar to home or incio of facebook using HTML and CSS. In my case, I did the following thing. To create a file HTML with… Continuing reading

Examples of edges and properties in CSS

Published the 23 of June of the 2017