Skip to main content

Internal Css in HTML



We will create separate block of css under head section using <style type="text/css"></style>
We will define three different types of block under the .css file.
#blockname
{
}
.blockname
{
}
htmlelementblock
{
}
#block will be called by id selector
<div id="blockname"></div>
.block will be called by a class selector
<div class="blockname"></div>
html element block will be called automatically
p
{
   width:100px;
   color:yellow;
}
<p></p>
Example of Internal Css in HTML:-
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
#header
{
height:100px;
background-color:#4867AA
}
#logo
{
         float:left;
         width:30%;
         height:75%;
         padding-top:10px;
         padding-left:160px;
}
#login{
float:right;
width:55%;
height:75%;
}
#logintable{
margin-left:100px;
margin-top:25px;
}
        #middlecontainer
        {
        height:650px;
        background-color:#EDF0F5;
        }
         #middleleft
        {
        float:left;
        height:100%;
        width:50%;
        border:1px solid red;
        }
         #middleleftfirst
        {
        margin-top:90px;
        margin-left: 100px;
        }
         #middleright
        {
        float:right;
        height:100%;
        width:49%;
        border:1px solid red;
        }
       #login input[type="button"]{

        background-color:blue;
        color:white;
        font-weight: bolder;
         border:0px ;
        }
       #login td{
         color:white;
        }
        a{
         color:white;
        }
       #middleleftfirst p{
        font-size: 27px;
        font-weight: bolder;
        color:blue;
        }
        #middleright tr{
        height: 50px;
        }
        .text1
        {
        height:35px;
        width:195px;
        border-radius: 3px;
        padding-left: 3px;
        }
        .text2{
        height:25px;
        width:400px;
        border-radius: 6px;
        }
        #birth
        {
        font-size: 22px;
        color: gray;
        font-weight: bolder;
        }
        #gender{
        font-size: 22px;
        color: gray;
        font-weight: bolder;
        }
        #middleright input[type="button"]
        {
        width: 200px;
        height: 35px;
        border-radius: 5px;
        background-color: green;
        }
         #middleright input[type="radio"]{
          color:black;
         }
        #footer{
        height:100px;background-color:#FFFFFF
        }
</style>
</head>
<body>
<div id="header">
<div id="logo">
 <img src="logo.jpg" width="210" height="75" />
</div>
<div id="login">
 <table id="logintable">
  <tr><td >Email or Phone</td><td style="color:white;">Password</td><td></td></tr>
  <tr><td><input type="text" /></td><td><input type="text" /></td><td><input type="button" value="Log in" ></td></tr>
  <tr><td></td><td><a href="" >Forgotten account?</a></td><td></td></tr>
 </table>
</div>
</div>
<div id="middlecontainer">
<div id="middleleft">
<div id="middleleftfirst">
<p >Facebook helps you connect and share with the people in your life</p>
   <img src="bg.png" >
    </div>
</div>
<div id="middleright">
<h1>Create An Account</h1>
<h3>It's quick and easy.</h3>
<table >
<tr><td style="width:32%;"><input class="text1" type="text" placeholder="First name" /></td><td style="width:63%;"><input class="text1" type="text" name="" placeholder="Surname"/></td></tr>
<tr s><td colspan="2"><input class="text2" type="text" placeholder="Mobile number or email address "/></td></tr>
<tr ><td colspan="2"><input class="text2" type="password" placeholder="New Password"  /></td></tr>
<tr><td colspan="2" id="birth">Birthday</td></tr>
<tr ><td colspan="2"><select><option value="">10</option><option value="">Day</option><option value="">1</option><option value="">2</option></select><select><option value="">DEC</option><option value="">MONTH</option><option value="">Jan</option><option value="">Feb</option></select><select><option value="">1994</option><option value="">YEAR</option><option value="">2019</option><option value="">2018</option></select></td></tr>
<tr ><td colspan="2" id="gender">Gender</td></tr>
<tr ><td colspan="2"><input type="radio"   />Female <input type="radio"   />Male <input type="radio"   />Custom</td></tr>
<tr ><td colspan="2"><p>By clicking Sign Up, you agree to our Terms, Data Policy and Cookie Policy. You may receive SMS notifications from us and can opt out at any time.</p></td></tr>
<tr ><td colspan="2"><input  type="button" value="Sign UP"   /></td></tr>
</table>
</div>
</div>
<div id="footer">

</div>
</body>
</html>

Comments

Popular posts from this blog

DSA in C# | Data Structure and Algorithm using C#

  DSA in C# |  Data Structure and Algorithm using C#: Lecture 1: Introduction to Data Structures and Algorithms (1 Hour) 1.1 What are Data Structures? Data Structures are ways to store and organize data so it can be used efficiently. Think of data structures as containers that hold data in a specific format. Types of Data Structures: Primitive Data Structures : These are basic structures built into the language. Example: int , float , char , bool in C#. Example : csharp int age = 25;  // 'age' stores an integer value. bool isStudent = true;  // 'isStudent' stores a boolean value. Non-Primitive Data Structures : These are more complex and are built using primitive types. They are divided into: Linear : Arrays, Lists, Queues, Stacks (data is arranged in a sequence). Non-Linear : Trees, Graphs (data is connected in more complex ways). Example : // Array is a simple linear data structure int[] number...

JSP Page design using Internal CSS

  JSP is used to design the user interface of an application, CSS is used to provide set of properties. Jsp provide proper page template to create user interface of dynamic web application. We can write CSS using three different ways 1)  inline CSS:-   we will write CSS tag under HTML elements <div style="width:200px; height:100px; background-color:green;"></div> 2)  Internal CSS:-  we will write CSS under <style> block. <style type="text/css"> #abc { width:200px;  height:100px;  background-color:green; } </style> <div id="abc"></div> 3) External CSS:-  we will write CSS to create a separate file and link it into HTML Web pages. create a separate file and named it style.css #abc { width:200px;  height:100px;  background-color:green; } go into Jsp page and link style.css <link href="style.css"  type="text/css" rel="stylesheet"   /> <div id="abc"> </div> Exam...

Conditional Statement in Python

It is used to solve condition-based problems using if and else block-level statement. it provides a separate block for  if statement, else statement, and elif statement . elif statement is similar to elseif statement of C, C++ and Java languages. Type of Conditional Statement:- 1) Simple if:- We can write a single if statement also in python, it will execute when the condition is true. for example, One real-world problem is here?? we want to display the salary of employees when the salary will be above 10000 otherwise not displayed. Syntax:- if(condition):    statements The solution to the above problem sal = int(input("Enter salary")) if sal>10000:     print("Salary is "+str(sal)) Q)  WAP to increase the salary of employees from 500 if entered salary will be less than 10000 otherwise the same salaries will be displayed. Solution:- x = int(input("enter salary")) if x<10000:     x=x+500 print(x)   Q) WAP to display th...