Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

Inserting CSS between body tags

inserting css inside body tags

  • Please log in to reply

#1 OneDes


    Senior Member

  • Designer
  • 282 posts

Posted 21 January 2013 - 04:44 PM

1 . First open your HTML file in an HTML editor or in Notepad. Locate the tags where you want to add the styles and then give them the "style" attribute. You can simply add the CSS code like this:
<div style="margin: 0 auto;">
This is an inline CSS. The code above centers the DIV on the page.
2.You have to add a space after the first style rule and then add another one, if required.
<div style="margin: 0 auto; font-style: bold;">
style rules should be separated with a semicolon. You can’t have more than one "style" attribute on the same tag.
3.Locate the part of the page where you want to place your CSS code. Add the "<style>" tags between "<head>" tags:
<style type="text/css">
/* Place your CSS code here... */

#2 Stylefox


    Junior Member

  • Designer
  • 2 posts

Posted 22 January 2013 - 10:26 AM

I would use a external stylesheet: (more flexibility)

<link rel="stylesheet" type="text/css" href="your-css-file-name.css" />

#3 pandor



  • Designer
  • 59 posts

Posted 19 February 2013 - 11:30 PM

I prefer external stylesheet too. Its easier to edit multiple pages part

#4 vibrasphere


    Junior Member

  • Designer
  • 20 posts

Posted 22 February 2013 - 06:49 PM

I'd say internal and inline CSS is dead. The only place where inline CSS is useful are the CMS-based websites. When adding content with integrated WYSISWYG editor or adding simple CSS manually.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users