/    Sign up×
Community /Pin to ProfileBookmark

putting things in order…

I have this simple code. It’s a photo and under it there’s a space for text. The thing that I have 1 pixel of white border around the photo and the text. The problem is that I have 3 pixels space between the photo and the text DIV. I want to make it 1 pixel as well… how?

[code]
.leftBar {
background: #fff;
padding: 1px;
width: 190px;
float: left;
}

.text {
background: #134f8e;
padding: 10px;
width: 190px;
height: 80px;
margin: 0px;
text-align: left;
font: 12px;
color: #fff;
}

<div class=”leftBar”>
<img src=”left1.jpg” width=”190″ height=”235″ alt=””>
<div class=”text”>
<b>title</b><br><br>

efkjdgkvkja kjlvha vh akljfgvhalk fvhakjfv
efkjdgkvkja kjlvha vh akljfgvhalk fvhakjfv
efkjdgkvkja kjlvha vh akljfgvhalk fvhakjfv
efkjdgkvkja kjlvha vh akljfgvhalk fvhakjfv
</div>
</div>
[/code]

Thanks!

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@ray326Sep 25.2004 — First start with semantic content. The content of the text class div should be a heading and a paragraph. Once the markup is right then you often have more stylistic opportunities.
Copy linkTweet thisAlerts:
@weeeauthorSep 25.2004 — <i>
</i>.leftBar {
background: #fff;
padding: 1px;
width: 190px;
float: left;
}

p {
font: 12px;
color: #fff;
}

.text {
background: #134f8e;
padding: 10px;
width: 190px;
height: 80px;
margin: 0px;
text-align: left;
font: 12px;
color: #fff;
}

&lt;div class="leftBar"&gt;
&lt;img src="left1.jpg" width="190" height="235" alt=""&gt;
&lt;div class="text"&gt;
&lt;p&gt;
efkjdgkvkja kjlvha vh akljfgvhalk fvhakjfv
efkjdgkvkja kjlvha vh akljfgvhalk fvhakjfv
efkjdgkvkja kjlvha vh akljfgvhalk fvhakjfv
efkjdgkvkja kjlvha vh akljfgvhalk fvhakjfv
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
Copy linkTweet thisAlerts:
@ray326Sep 25.2004 — <div class="text">

<h3>title</h3>

<p>

efkjdgkvkja kjlvha vh akljfgvhalk fvhakjfv

efkjdgkvkja kjlvha vh akljfgvhalk fvhakjfv

efkjdgkvkja kjlvha vh akljfgvhalk fvhakjfv

efkjdgkvkja kjlvha vh akljfgvhalk fvhakjfv

</p>

</div>

Although I think I'd put the image and the text in the same div (but I haven't really thought that through).
Copy linkTweet thisAlerts:
@weeeauthorSep 25.2004 — I still have a 2 pixel space between the photo and the text...
×

Success!

Help @weee 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.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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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