Bootstrap 4 CDN


Go to template search the code   <head>   tag and paste the code  just above it

Bootstrap 4  CDN for bloggers :


<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>

aaa

https://getbootstrap.com/docs/4.0/components/forms/

Make Bootstrap Navbar sticky

The simple way to make bootstrap navbar sticky , just add class name sticky-top to your navbar. But its only working if navbar element had direct child of body. If the navbar wrap in some other div it will not work.

So if  so many div is used in navbar child, we need to use some JavaScript to make it sticky , 


document.addEventListener("DOMContentLoaded", function(){
  window.addEventListener('scroll', function() {
      if (window.scrollY > 50) {
        document.getElementById('navbar_Id').classList.add('fixed-top');
        // add padding top to show content behind navbar
        navbar_height = document.querySelector('.navbar').offsetHeight;
        document.body.style.paddingTop = navbar_height + 'px';
      } else {
        document.getElementById('navbar_top').classList.remove('fixed-top');
         // remove padding top from body
        document.body.style.paddingTop = '0';
      } 
  });
}); 




Need to change : 

 
change the code navbar_id with your own navbar 


subject to change : 




Understanding of code : 


  • Now check if window scrolled window.addEventListener('scroll', function() { ... }
  • Check if scrolled more than x amount of px if (window.scrollY > 50) { ... }
  • Select navbar element and add function classList.add('fixed-top'); to fix on top
  • Remove class fixed-top when page scrolled back to top

LOGO designing tips

TO design a high quality logo , We must have to be careful and work out on below facts, 


Use SVG image 

SVG image is one of the best option to give a quality high resolution look  to your logo to use in  website or other online publishing platform. But it is sad to say , that all major CMS or webbuilder like WordPress , bloggers etc not supporting SVG file format. But it is allowed to use SVG file through embeded src image code. But the problem is , but to do so we need to host the image but Also major image hosting site like fliker , google photos etc are not hosting SVG image.

Due to alot of research i found a free svg hosting website , where we can easily host the svg image and get link to embeded our web project, website link is given below.

200






Bootstrap Buttons

 How to write Button HTML code : 

A  html to create a button can be write between start  button element tag  <button> and end button element tag </button> , Must write  type="button" and class="btn" to tell the browser this a button element.

also mention the button unique class name of your choise to for the unique identity in different project. 
Example is given below :


<button type="button" class="btn uniquebuttonclass"> Button Name  </button>


Link Button HTML code 


Just put the button between link start element <a> and link close element </a>
example are  given below:

<a type="button" class="btn uniquebuttonclass" href="#link-goe-here ">Button Name </a>



CSS code for Button Styling 




.button { 
  
  position: Relative;
  margin :40px;
  font-size:12px ;  
  background:#780000; 
  border:0px; 
  outline:none;
  padding: 6px !important;
  color:#fff!important; 
  cursor: pointer;
  
   }

 

Now here , We can set the value of styling items as per your requirements.

Button Styling on hover effect : 


We may create the certain effect when the mouse cursor goes over the button. 
example are given below:



.button:hover { 

background:#000000; 
color:#fff; 
outline:1px; 
transform: scaleX(1.2);
border:1px solid #eee; 
text-decoration: none;

}



Button Styling on Active status : 

We may create the certain effect when button will be in active status, Active means untill the button being clicked or pressed the effect applied in that certain time. Must use to create mobile effect , as there is no hover effect visible in mobile view in lake of clicking so Active styling can be used for that.
example are given below:

600
.button:active {

background:#000000;
color:#fff;
outline:1px;
transform: scaleX(1.2);
border:1px solid #eee;
text-decoration: none;

}



Button Styling focus used for after click effect : 


We may also create the after click effect for button , the effect can be seen for button after click until not clicked again anywhere of the webpage. Useful for drop dropdown or accordion function type button.  this effect not working when click outside .

Disadvantage-   with the focus tag , effect not disappear on double click over the menu/button tab. that is the negative side with focus.

example are given below:


.button:focus {

background:#000000;
color:#fff;
outline:1px;
transform: scaleX(1.2);
border:1px solid #eee;
text-decoration: none;

900

style the  dropdown ul class main menu when the chil dropdown menu open working for bootstrap menu only : 

This code  working for bootstrap dropdown menu either for button  segment and navbar segment , difference is  just change the main class to see effect on both segment ,  well i am writhing a common code here which work for both segments :

-- this effect work for both click and touch device 
-- the given CSS effect visible when click the main ul /button tab.
-- the effect  will disappear on double click on the ul/button tab, that doesn't happened with focus tag.

Grab the code below  and enjoy designing :

600

   .dropdown-toggle[aria-expanded="true"] {

background:#eeeeee; 
border-bottom:3px solid #015FFA;
color: #a50000;
     
}


700





Google material icons

Google material icons are one of the reliable source to use it free in your website or projects. it is available thorough CDN or one can download to use it easily on their official site , link is given below :

Google Icons

Add in your online project or website through CDN path :



 <link href="https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Two+Tone|Material+Icons+Round|Material+Icons+Sharp" rel="stylesheet"/>


How to Add  HTML :


Add the icon directly in HTML page in below given format, Normal solid view 
use material-icons class , if you want add outlined view use material-icons-outlined class
Example are given below : 


<i class = "material-icons myclassname"> place</i>

<i class = "material-icons-outlined myclassname"> place</i>
 

Must include your specific class , myclassname is the specific class given in above example , which can help to decorate the icon through css

Decorate the icon through CSS :



i.myclassname {   

    font size: 20px;   
    color:#A500000;  
    margin-left:-21px;
    padding-right:4px;
    padding-top:-10px;
    margin-top:0px;
    position: absolute;

}



Add icon using content unicode in  CSS :



    .myclassname ::before {

    font-family: 'Material Icons';
    content: "\e876";
    margin-left:-21px;
    padding-right:4px;
    padding-top:-10px;
    margin-top:0px;
    position:absolute;

}



Useful material icons for menu design: 



expand_more expand_more 

<span class="material-icons-outlined"> expand_more </span>

Font-family:'material-icons-outlined';
CSS unicode-
content:  #e5cf;

___________________


expand_less expand_less 

<span class="material-icons-outlined"> expand_less </span>

Font-family:'material-icons-outlined';
CSS unicode-
content:  #e5ce;

____________________


chevron_right chevron_right 

<span class="material-icons-outlined"> chevron_right </span>
Font-family:'material-icons-outlined';
CSS unicode-
content:  #e5cc;

______________________

chevron_left chevron_left 

<span class="material-icons-outlined"> chevron_left </span>
Font-family:'material-icons-outlined';
CSS unicode-
content:  #e5cb;

__________________

add Add

<span class="material-icons-outlined">add </span>

Font-family:'material-icons-outlined';
CSS unicode-
content:  #e145;

___________________

remove Remove

<span class="material-icons-outlined">remove </span>

Font-family:'material-icons-outlined';
CSS unicode-
content:  #e15b;

____________________

bootstrap navbar close on click outside


Close bootstrap Navbar-collapse on click outside the Navbar,

 just use the give code in code box below to get the required result.


$(document).click(function (e) {  
    if($('.collapse').hasClass('show') && !$('nav').is(e.target) && $('nav').has(e.target).length === 0){
        $('.navbar-toggler').click()
    }
})

How to add meta tag in HTML page


Add keyword to Blogger Post 

just to go post editor then edit html section and copy and paste the meta tag code given in below box. change the keyword section with your target keyword , more keyword can be added with comma



<meta name="keywords" content="type here all your keywords separated by comma"/>


Add meta description for Blogger : 



<meta name="description" content="type your description here"/>