Float Property in css

Float

The float property allows us to take an element, remove it from the normal flow of a page, and position it to the left or right of its parent element. like if we want to move an image on the left side of the screen we can use

img{

float: left;

}

Clear
when we use float element it will change the normal flow of the page even changes the margins and padding. Also, changes the default display value we must keep an eye on their display property. so to remove or solve this issue we can use clear

now the clear has three values
left, right, both

clear:left;                          // removes the left float
clear:right:                       //removes the right float
clear: boht:                      //removes both right and left float

Advertisements

Graphics.h in ubuntu

How to use Graphics.h in ubuntu?

Now you can use Graphics.h in ubuntu with gcc compiler.You just have to follow these few steps to install.

Step #1
Make sure that you have installed basic compilers for this just open terminal by using ctrl+alt+t, then type this commond.

$sudo apt-get install build-essential

Step #2
After that we have to install these packages. You just simply type this command in terminal.

$sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 guile-1.8-dev libsdl1.2debian-all libart-2.0-dev libaudiofile-dev libesd0-dev libdirectfb-dev libdirectfb-extra libfreetype6-dev libxext-dev x11proto-xext-dev libfreetype6 libaa1 libaa1-dev libslang2-dev libasound2 libasound2-dev

Step #3
Now download this libgraph

Now extract it into home folder and run following commands

  • $cd libgraph-1.0.2
  • $./configure
  • $sudo make
  • $sudo make install
  • $sudo cp /usr/local/lib/libgraph.* /usr/lib

Now you are ready to compile your graphics program
To Compile a graphics program
First make program
In programs using graphics.h in Turbo C, you’ll be using something like this:

int gd=DETECT,gm;
initgraph(&gd,&gm,”c:\\tc\\bgi”);

In Ubuntu, you replace the “c:\\tc\\bgi” part with a NULL

int gd=DETECT,gm;
initgraph(&gd,&gm,NULL);

now make your program and compile it. 🙂
for example I have made design.c
then compile it by

$gcc design.c -o design -lgraph

then run it by

$./design
now see the design 🙂

start:-

Screenshot from 2014-02-01 20:40:34      

end-:

Screenshot from 2014-02-01 20:43:32