/    Sign up×
Community /Pin to ProfileBookmark

css wont move image, but the html does.

Hi, Im trying to put my second image on the right side. The css, doesnt matter what alterations I do, it has no effect, but the html, when I put img src in under the body tag, then it moves to the right, if I put align:right in.
The css now is #webtheme.jpg2
{
position:absolute;top:10px;left:700px;
width:155px;margin:30px;auto;
height:317px;
background-image:url(‘webtheme.jpg2’);
background-position:right top;
background-repeat:no-repeat;
align:right;
}
html code is under the <body>
<img src=”images/webtheme.jpg2 width=”155″ height=”317″ alt=”” title=”webtheme.jpg2″ border=”0″ align=”right”/>

I just put the align:right in the css to see if it would work then. Also tried taking align right out the html and leaving the align right in the css.
Also tried the other way, putting the width, height, border, background-image,background-position, background-color, background-size, background-repeat, in those orders in the css. The css just wont work. Ive got this image in coffee cup editor. It puts the image in the page, but in the wrong place, so I try deleting it, putting my own code in. Also the coffee cup puts the image in with just the html code: <img src= etc, etc.> then the a href.
But it doesnt put the css in. Only put the css in for the first image, which it put under .body { etc, etc, in the css. Ive given this <img id=”webtheme.jpg2″/> under the <body> in html.

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@TheAliveWinnerMay 01.2012 — [I]align[/I] is a [B]deprecated attribute[/B] of [I]html[/I].

[I]From now onwards, consider not using it [B]to comply with the standards[/B]![/I]

But as the browsers still support it, you got it working in html.

Also [B]CSS does not understand it[/B] (...because this property does not belong to CSS).

Use the [I]float[/I] property in CSS to align the image!

To learn about [I]float[/I], check this: CSS Floating
Copy linkTweet thisAlerts:
@TheAliveWinnerMay 01.2012 — Try this:
[code=html]
#webtheme.jpg2 {
position: absolute;
top: 10px;
left: 700px;
width:155px;
margin: 30px auto;
height: 317px;
background-image: url('webtheme.jpg2');
background-position: right top;
background-repeat: no-repeat;

float: left;
}
[/code]


Does this work?

Reply to me if it doesn't because I have just edited your code!

[I]

I have not tried to debug it in any browser![/I]
Copy linkTweet thisAlerts:
@wildguy2authorMay 02.2012 — I was just wondering, maybe it wont work, cause I dont put any <a href> code in anywhere, is this essential, Im using coffecup. editor.

thanks
×

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,
)...