/    Sign up×
Community /Pin to ProfileBookmark

Do I have to put <div style> and all its attributes.

Hi, do I have to put a <div style> in the html part, when I put a div class in the css ontop of the page. Cant I just put a name ontop as the class.
Then put <div class=”name”> or whatever in the html. For example.
Put #image1 { and its properities and values in the Css ontop of page under the <head> tag and then put <div class=”image1> in the <body>
Is it aslo necessary to put <a href= > in the html, if I put the url in the Css ontop page.

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@chryanerMay 05.2012 — if you want <div class="image1> to be link to redirect users, than you should put a <a href=>

in the #image1 you can define the background image of the div, not the redirection link..
Copy linkTweet thisAlerts:
@Major_PayneMay 05.2012 — It is always best to have an external CSS file unless you only have one or two pages. Then use of embedded CSS probably would be easier for you if linking to an external CSS file is too much.

Following should help you with CSS...

Between the head tags of each page: &lt;link rel="stylesheet" type="text/css" href="css-file-name.css"&gt;

CSS Tutorials:

Twenty Advanced CSS Tutorials: http://designfestival.com/twenty-top-advanced-css-tutorials/?utm_medium=email&utm_campaign=DesignFestival+28th+March&utm_content=DesignFestival+28th+March+CID_680293a20cd22640a5f4088681da6c50&utm_source=Newsletter&utm_term=More

Advanced CSS: http://www.yourhtmlsource.com/stylesheets/advancedcss.html

http://www.handycss.com/

http://www.w3.org/Style/Examples/011/firstcss

http://www.csstutorial.net/

Dynamic Drive CSS Library: http://www.dynamicdrive.com/style/

http://www.echoecho.com/css.htm

http://htmldog.com/guides/cssbeginner/

http://www.davesite.com/webstation/css/

http://www.htmlcodetutorial.com/character_famsupp_193.html

http://www.w3schools.com/Css/default.asp

LESS Is More: Make Your CSS Coding Easier with LESS: http://www.elated.com/articles/less-is-more-make-your-css-coding-easier-with-less/

CSS Layout Generator: http://csscreator.com/version2/pagelayout.php
Copy linkTweet thisAlerts:
@spufiMay 05.2012 — Hi, do I have to put a <div style> in the html part, when I put a div class in the css ontop of the page. Cant I just put a name ontop as the class.

Then put <div class="name"> or whatever in the html. For example.

Put #image1 { and its properities and values in the Css ontop of page under the <head> tag and then put <div class="image1> in the <body>

Is it aslo necessary to put <a href= > in the html, if I put the url in the Css ontop page.[/QUOTE]


If you use a class attribute:
<i>
</i>&lt;div class="name"&gt;


<i>
</i>.name {
//CSS
}


If you use an id attribute:
<i>
</i>&lt;div id="name"&gt;


<i>
</i>#name {
//CSS
}
×

Success!

Help @wildguy2 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...