Showing posts with label CSS tutorials. Show all posts
Showing posts with label CSS tutorials. Show all posts

CSS Tutorial : How to hide selected scrollbar on web pages

1 comment
This post based the question/comment of +Nauman Afzal Zia In the related article : How to remove scrollbar in your blog/site pages.

"Hi! This was really helpful. I am actually making a Survey from Google Doc. I got its code and embed it on my blog. Now there were two scroll bars there. One from the survey and one from the main page. With your code I have removed both. Can you help me removing the inner one only. I mean I need one on the blog but not on the survey."




In that post the codes is working for hide all of scrollbar in the pages. If you only want to hide selected scrollbar on web pages, you can do that by insert the Css codes below :


/* To remove Body Scrollbar (Main Scrollbar in right side)

body::-webkit-scrollbar {display:none;}
body::-moz-scrollbar {display:none;}
body::-o-scrollbar {display:none;}
body::-google-ms-scrollbar {display:none;}
body::-khtml-scrollbar {display:none;}


Also, you can hide spesific scrollbar on the pages by mention Class/Id Selector. For example, you want to hide scrollbar of div tag by class "testing" :


/* To remove .testing Scrollbar

.testing::-webkit-scrollbar {display:none;}
.testing::-moz-scrollbar {display:none;}
.testing::-o-scrollbar {display:none;}
.testing::-google-ms-scrollbar {display:none;}
.testing::-khtml-scrollbar {display:none;}

Okay, That's all guys. Hope you helped by this. Keep Spirit and Happy Blogging :)
Read More...

CSS Tutorials #1 : Know The Most Commonly Used Of CSS Properties Part 2

Leave a Comment

This is the next part of the previous tutorial, so if you don't have read the previous tutorial, please see that in here :

CSS tutorial #1 : Know The most commonly Used of CSS propreties

We still talk about the most common use of CSS properties. In previous post, I just have told you 2 points. But, now is more. And, from now i won't explain by theory. Because that's boring. So i will explain by practical and a little note.

3. CSS text styling : text-align, text-transform, text-decoration.

Let's see the implementation :

<div class="selector">

This is the implementation of text-align, text-transform, and text-decoration.

</div>
<style type="text/css">
.selector {
border:1px solid black;

text-align:right;
text-transform:Uppercase;
text-decoration:underline;
}

</style>

The codes above will generate the output like this :

This is the implementation of text-align, text-transform, and text-decoration.

The values you can fill for the three properties above is :

text-align: "right", "left", "justify", and "center".
text-transform: "Uppercase", "Capitalize", "lowercase", and "none".
text-decoration: "underline", "line-through", "blink", "overline" and "none".

please try all of the values if you want to know the function of those all.


4. CSS Font Styling : Font-size, Font-family, Font-weight, Font-style

Let's see the implementation :

<div class="selector1">

This is the implementation of Font-size, Font-family, Font-weight, and font-style.

</div>
<style type="text/css">
.selector1 {
border:1px solid black;
font-size:14px;
font-family:arial;
font-weight:bold;
font-style:italic;
}

</style>

The codes above will generate the output like this :

This is the implementation of Font-size, Font-family, Font-weight, and font-style.


The values you can fill for the three properties above is :

font-size: you just can input the values by "pixel".

font-family: There are too much kind of font you can input as values. See on Microsoft office word fonts. Also, you can input the value by combine some of fonts Like this :

font-family:calibri, arial, Trebuchet MS;

The output will be generate the new font. But the first font (in the code above is "calibri") will be dominant font.

font-weight: "0", "100", "200", "300", "400", "500", "600", "700", "800", "900", "bold", "bolder", "Lighter", and "normal".

font-style: "italic", "oblique", and "normal".

please try all of the values if you want to know the function of those all.

5. Float

Let's see the implementation :

<div class="selector2">

<div class="float1">
This is markup.
</div>

<div class="float2">
And this is other markup.
</div>

</div>

<style type="text/css">
.selector2 {
width:500px;
height:200px;
}
.float1 {
float:right;
width:240px;
height:150px;
background:black;
color:white;
}
.float2 {
float:left;
width:240px;
height:150px;
background:white;
}
</style>

The codes above will generate the output like this :

This is markup.
And this is other markup.


Note : To use "float", you must use width and height. Because, without width and height, the "float" will seen like not functioned. Also, I use the background color to make mark the "float1" and the "float2".

The values :

float : "left", "right", and "none".


6. Position

Let's see the implementation :

<div class="selector3">

<div class="relative">
This is Markup with "Position:relative;"
</div>

<div class="absolute">
This is Markup with "Position:absolute;"
</div>

<div class="fixed">
This is just demo for "Position:fixed;"
</div>

<div class="static">
This is Markup with "Position:static;"
</div>

</div>

<style type="text/css">
.selector3 {
width:500px;
height:300px;
border:1px solid black;
 position:relative;
font-size:12px;
}
.relative {
width:150px;
height:100px;
position:relative;
background:blue;
}
.absolute {
width:150px;
height:100px;
position:absolute;
background:black;
top:0px;
right:0px;
}
.fixed {
width:150px;
height:100px;
position:fixed;
background:red;
bottom:0px;
left:300px;
}
.static {
width:150px;
height:100px;
position:static;
background:green;
}
</style>

The code above will generate the output like this :

This is Markup with "Position:relative;"
This is Markup with "Position:absolute;"
This is just demo for "Position:fixed;"
This is Markup with "Position:static;"


Note : As you see, CSS position have 4 option of values : "relative", "absolute", "fixed", "static". Explaining all functions of values are complicated to me. So, I give you the sample of all. just try it all and know the functions. For "position:absolute;" and "position:fixed;" you must use the properties of "bottom", "top", "right", and "left" to set the position. The values is by "pixel".

Okay. That's all for first tutorial. I hope this is helping you. Wait for the next tutorials next week.. See you ;)


~Muhammad Syakirurohman with his young spirit~

Read More...

CSS tutorials #1 : Know the most commonly used of CSS properties part 1

Leave a Comment
Hello, blogger long time no see :D.. Here i online again and will share something to you. Now and then i will make posts series about CSS tutorial.And, I promise to never stop posting on the way :D, I will post every week(on saturday or sunday) for this series. Okay, Let's begin..

First you must read this article to know basic of CSS :

KNOW THE CSS CODE FOR YOUR BLOGS

Image from cscie12.dce.harvard.edu
If you have read the post above, Now i will assume you that you have know how to use CSS in the website or blog. Now we will talk about CSS properties that most commonly used by people.



1. Background and color

Well, from the name i sure that you have know what is background and what is color. Okay, just go ahead to implementation.

<div class="selector1">This is implementation of CSS background and color</div>
<style type="text/css">
.selector1 {
background:black;
color:green;
}
</style>

The code above will be generate the output like this :


This is implementation of css background and color

The values
Above, i use value of "black" for background and "green" for color. if so, your option is limited because you can only input the value by the color name you know. Because of that, you should input the value by hexadecimal codes or rgb(red,green,blue). By this kind of values, you option is very much. The sample of use is :

*hexadecimal
background:#000000;          -#000000 is hexadecimal codes for black-
color:#00ff00;                      -#00ff00 is hexadecimal codes for green-

*RGB
background:rgb(0,0,0);         -rgb(0,0,0) is hexadecimal codes for black-
background:rgb(0,255,0);     -rgb(0,255,0) is hexadecimal codes for green-

Rgb is color setting by combine 3 of basic color (red, green and blue). The smaller value then the color will be  darker. The bigger value then the color will be brighter. Each of basic color have value from 0 to 255. Essentially, Hexadecimal and RGB is related. They are have same pattern. See, i will compare them by sample of "green".

#00ff00
rgb(0,255,0)

If we compare them we will take a conclusion that :
# is other form of rgb,
00 is other form of 0,
ff is other form of 255,
00 is other form of 0

yeah, like that. If you want learn more about hexadecimal and RGB just see it :

COLOR PICKER TOOL

2. Width, Height, Border, Margin and Padding

Surely, for width, height and border you have know what the means they are. But, for margin and padding, i will tell you what they are, because maybe they are different with what you think. Margin is an invisible line outside the selector area that separate it with other areas. The size of margin determine the range with other selector areas. While, Padding is an invisible line inside the selector area that give range between border of area and the contents therein. This is how to use them:


<div class="selector2">
<div>This is implementation of CSS Width, Height, Border, Margin and Padding</div>
</div>
<style type="text/css">
.selector2 {
width:200px;
height:100px;
overflow:hidden;
border:1px #000 solid ;
padding:5px;
margin:5px;
}
.selector2 div {
background:#000;
color:#fff;
height:100px;
}
</style>

The code above will be generate the output like this :

This is implementation of CSS Width, Height, Border, Margin and Padding.
Which is border, padding, and margin?
-border is the black line that surrounding the area.
-Padding is the no color space between border and the sentences "This is implementation of CSS Width, Height, Border, Margin and Padding".
-Margin is invisible outside the border. Margin will only be known if there are other areas that adjacent.

Image from www.templatemonster.com


The values
-Width and height : you can input value by "pixel" and "percent" (Like this :width:100%;). If you use percent, the real value is the pixel value of the parent element. The example is : if you add "width" or "height" property in to selector ".selector2 div" with value "90%", Then the real value is "90%" of "200px" (width/height of ".selector2"). Also, you can input the value by "auto" if you want to automatic.

-Border: "1px" is the size of border. "#000" is the color (Also you can use hexadecimal codes and rgb). And "solid" is the type of border. There are various type of border you can use. This is the list :
   -medium
   -thin
   -thick
   -dashed
   -dotted
   -double
   -groove
   -inset
   -outset
   -ridge
   -solid

if you want just make 1 side of border, like right side, you can use this code "border-right:1px #000 solid;"

-Margin and padding : 5px is size of margin/padding. If you want to use margin/padding only for 1 side, like right side, you can use this code "margin-right:5px;" or "margin:0px 5px 0px 0px;" (note: "margin:'upmargin' 'rightmargin' 'bottommargin' 'leftmargin'; "). Special for margin, you can make the area be located at center position by code "margin:auto;" or "margin:0 auto" or "margin:0 auto 0 auto;".. But it is not working for padding.

yeaah, for today i just share until here. Just wait the part 2 next week. See you :). Hope this stuff is very helping you.

~Muhammad Syakirurohman with his young spirit~

Read More...