/    Sign up×
Community /Pin to ProfileBookmark

Just not happening

I can’t get the style defined at the top of the page to properly work with it’s class further down: ?

[url]http://www.zerofivezero.net/the_project102.html[/url] – click “Forum” from nav

[CODE]#img {
float: left;
padding-bottom: 10px;
}
#img2 {
float: right;
padding-bottom: 10px;
}

#news {
position: absolute;
margin-top: 15px;
background-color:#FFFFFF;
left: 15px;
font:13px “Arial”;
color:#000000;
}
[/CODE]

[CODE] <div class=”img”><img src=”images/news_thumb1.jpg”
alt=”” border=”1″ height=”75″ width=”80″ /></div>
This is the news section<br />
Yep, this is where the news will be. This will be the short blurb about
the story.
[/CODE]

to post a comment
CSS

9 Comments(s)

Copy linkTweet thisAlerts:
@mrblobbyOct 08.2008 — if you're trying to position #news absolutely in relation to #img give image a position: relative;

Can't see a div called news in your code though.

btw . means class and # means id.
Copy linkTweet thisAlerts:
@no_good_at_thisOct 08.2008 — From what i can gather you don't have an classes declared just id's
Copy linkTweet thisAlerts:
@no_good_at_thisOct 08.2008 — sorry ignore my post what i saw is completely different to what is written above, dont know what happened there!
Copy linkTweet thisAlerts:
@mattpoochauthorOct 08.2008 — I'm not sure what happened either, how do I define the classes?
Copy linkTweet thisAlerts:
@mrblobbyOct 08.2008 — <div id="name_of_your_id"> translates to #name_of_your_id

<div class="name_of_your_class"> translates to .name_of_your_class

They're case-sensitive too
Copy linkTweet thisAlerts:
@mattpoochauthorOct 08.2008 — Ah ha, that did it, thank you! Now, how can I get those tabs and content to same location (x,y)?

http://www.zerofivezero.net/the_project108.html
Copy linkTweet thisAlerts:
@mrblobbyOct 08.2008 — sorry dude not sure what you're trying to do. In any case using position:absolute is pretty heavyweight if you're trying to nudge anything else than images or content you know the exact dimensions of into the right place. Floating and clearing often works wonders.
Copy linkTweet thisAlerts:
@mattpoochauthorOct 08.2008 — I'm trying to make it so that all content in that left frame (swf, news, forum, donate, etc) are all the same number of pixels below the nav...here's where I stand: http://www.zerofivezero.net/the_project1081.html
Copy linkTweet thisAlerts:
@WebJoelOct 08.2008 — [B]<div class="img">[/B]<img src="images/news_thumb1.jpg"

alt="" border="1" height="75" width="80" />[B]</div>[/B][/QUOTE]
Unnecessary DIV-itis. You don't have to 'DIV[I]itis[/I]' an element, -just style it [I]directly[/I]...

<img [B]class="img"[/B] src="images/news_thumb1.jpg"

alt="" border="1" height="75" width="80" />[/QUOTE]
and move the 'inline css' to ".class"

so:border="1" height="75" width="80"[/QUOTE]becomes:

[B][SIZE="5"].[/SIZE][/B]img {

float: left;

padding-bottom: 10px;

[B]border:1px; height:75px; width:80px[/B];}[/QUOTE]
Note that the format changes from '[B]Selector="declaration"[/B] ' to '[B]Selector:declaration;[/B]" (colon instead of equals-sign, and use of unit-of-measure, in this case, "px".

And "class" is "[SIZE="5"][B].[/B][/SIZE]", id is "[B][SIZE="3"]#[/SIZE][/B]" as pointed out earlier..)

I might even go as far to suggest not naming "class" or "id"s with a 'tag'... (don't name anything #p, #font, #form, etc)... too confusing and you will eventually encounter a problem with this.. jmo
×

Success!

Help @mattpooch 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...