Css Course

To can center a fixed or absolute positioned element (Div or other block element), set the right and left CSS properties to 0, and then margin-left and margin-right to auto, as if you were centering a static positioned element.
- Example, centering a fixed Div:
<style type="text/css">
#divid {
  position: fixed;
  /* center the element */
  right: 0;
  left: 0;
  margin-right: auto;
  margin-left: auto;
  /* give it dimensions */
  min-height: 8em;
  width: 90%;
  background: #dafeda;
}
</style>

<div id="divid">https://CoursesWeb.net/</div>
- Example, centering an absolute positioned Div (the parent element must have: position: relative):
<style type="text/css">
#parent{
 position:relative;
 height:8.5em;
}
#divid {
  position: absolute;
  /* center the element */
  right: 0;
  left: 0;
  margin-right: auto;
  margin-left: auto;
  /* give it dimensions */
  min-height: 8em;
  width: 90%;
  background: #dafeda;
}
</style>

<div id="parent">
  <div id="divid">https://marplo.net/jocuri</div>
</div>
Demo:
https://CoursesWeb.net/

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag defines the clickable areas inside the image map?
<map> <img> <area>
<img src="image.jpg" usemap="#map1">
<map name="map1">
  <area shape="rect" coords="9, 120, 56, 149" href="#">
  <area shape="rect" coords="100, 200, 156, 249" href="#">
</map>
Which CSS property defines what is done if the content in a box is too big for its defined space?
display overflow position
#id {
  overflow: auto;
}
Click on the event which is triggered when the mouse is positioned over an object.
onclick onmouseover onmouseout
document.getElementById("id").onmouseover = function(){
  document.write("Have Good Life");
}
Indicate the PHP variable that contains data added in URL address after the "?" character.
$_SESSION $_GET $_POST
if(isset($_GET["id"])) {
  echo $_GET["id"];
}
Center Fixed and Absolute element

Last accessed pages

  1. Mixins (216)
  2. Get Duration of Audio /Video file before Upload (15282)
  3. JavaScript trim, rtrim and ltrim (13040)
  4. $_GET, $_POST and $_REQUEST Variables (33708)
  5. AJAX Tutorials (508)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (240)
  2. Read Excel file data in PHP - PhpExcelReader (83)
  3. The Four Agreements (72)
  4. PHP Unzipper - Extract Zip, Rar Archives (72)
  5. The Mastery of Love (60)