foreach ($instPosts as $elem) {
echo '<div><img src="'.$elem.'"></div>';
}
foreach ($instPosts as $elem) {
echo "<div><img src=\"$elem\"></div>";
}
foreach ($instPosts as $elem) {
?>
<div><img src="<?php echo $elem; ?>"></div>
<?php
}
foreach ($instPosts as $elem) {
?>
<div><img src="<?=$elem; ?>"></div>
<?php
}
div:nth-child(5n+1), div:nth-child(5n+2) {
width: 49%;
display: inline-block;
}
div:nth-child(5n+3), div:nth-child(5n+4), div:nth-child(5n+5) {
width: 33%;
display: inline-block;
}
function exclude($list, $exceptions){
$flipped = array_flip($list);
foreach ($exceptions as $exception) {
unset($flipped [$key]);
}
$list= array_flip($flipped );
return $list;
}
var lev = 0; // level
var selector = 'html'; // root tag
var els = document.querySelectorAll(selector);
var root = els;
while(els.length > 0){
for(j=0; j<els.length; j++){
// тут колдунство над els[j];
}
lev++;
selector += ' > *';
els = document.querySelectorAll(selector);
}
<div class="figure"></div>
<style>
.figure {
width: 250px;
height: 50px;
background-color: orange;
border-radius: 15px;
position: relative;
}
.figure:before {
content: '';
width: 234px;
height: 25px;
background-color: orange;
display: block;
position: absolute;
left: 8px;
top: 35px;
border-radius: 50%;
}
</style>
<div class="memory" memory="128-gb">128-gb</div>
<div class="memory" memory="64-gb">64-gb</div>
<div class="memory" memory="256-gb">256-gb</div>
<script>
unordered = {};
keys = Array();
divs = document.querySelectorAll('.memory');
for(i=0; i<divs.length; i++){
keys[i] = divs[i].attributes.memory.nodeValue;
unordered[divs[i].attributes.memory.nodeValue] = divs[i];
parentCont = divs[i].parentNode;
divs[i].remove();
}
keys = keys.sort();
for(i=0; i<keys.length; i++){
parentCont.appendChild(unordered[keys[i]]);
}
</script>
<head>
<script defer="defer" src='scripts/script.js'></script>
</head>
<head>
<script defer="defer">
window.onload = function() {
document.getElementById('mobile_main_nav').onclick = function() {
openbox('mobile_main_nav_items', this);
return false;
};
};
// если блок включен
function openbox(id, toggler) {
var div = document.getElementById(id);
if(div.style.opacity == 1) {
div.style.height = 0;
div.style.opacity = 0;
toggler.innerHTML = 'Открыть';
toggler.style.background = '#393b3f';
}
// если блок выключен
else {
div.style.opacity = 1;
div.style.height = '155px';
toggler.innerHTML = 'Закрыть';
toggler.style.background = '#393b3f';
}}
</script>
</head>
.square{
height: 100px;
width: 100px;
background: red;
animation-fill-mode: forwards;
animation-direction: alternate;
animation: squareq linear 1s;
}
.square:hover{
animation: square linear 1s;
}
@keyframes square {
from {
width: 100px;
height: 100px;
}
25% {
height: 100px;
width: 200px;
}
50% {
width: 200px;
height: 200px;
}
75% {
width: 200px;
height: 100px;
}
to {
width: 100px;
height: 100px;
}
}
@keyframes squareq {
from {
width: 100px;
height: 100px;
}
25% {
height: 100px;
width: 200px;
}
50% {
width: 200px;
height: 200px;
}
75% {
width: 200px;
height: 100px;
}
to {
width: 100px;
height: 100px;
}
}
<a href="#nul" onclick="window.open('http://site.com/page.html ','','Toolbar=1,Location=0,Directories=0,Status=0,Menubar=0,Scrollbars=0,Resizable=0,Width=550,Height=400');">Название</a>