How do I turn off image scaling?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I turn off image scaling?

Daniel Hinojosa
I need it of fixed size.  I think I can do it with CSS, BUT I noticed that when I create an "id" for an image, for example:

== Todo Today 2
[.todotoday]
--
[[blank-to-do-today]]   <--------------  Image ID?
image::blank-to-do-today-list.png[ToDoToday]

[.line1]
This text is displayed in line 1.
--
<<<<

The actual id is on a div and _Not_ on an image
<div class="openblock todotoday">
  <div class="content">
     <div class="imageblock" id="blank-to-do-today">  <----dude, what?
         <div class="content">
             ToDoToday <-- Y No id Here?
          </div>
     </div>
     <div class="paragraph line1"><p>This text is displayed in line 1.</p></div>
   </div>
</div>

So how do I get around this perplexing issue
All my love,
Danno
Reply | Threaded
Open this post in threaded view
|

Re: How do I turn off image scaling?

mojavelinux
Administrator
Daniel,

I'll address the two questions you have separately.

== 1. Setting fixed image dimensions

If you want to set the fixed height and width of an image, you can specify the dimensions (width,height) explicitly in the image macro:

image::filename.png[Alt Text,100,200]

If you want to apply the same fixed dimensions to all images, you could use an attribute reference:

image::filename.png[Alt Text,{imagesize}]

where imagesize resolves to width,height values.

== 2. id attribute placement

The id attribute is placed on the containing div instead of the img tag to conform with the output produced by AsciiDoc Python. That doesn't necessarily mean it's the right semantics, so we'll want to revisit it when creating the semantic HTML backend as proposed in issue {242}.

However, there are at least some advantages to putting the id and roles on a surrounding div worth discussing. CSS does not allow you to style the parent of a selector (without some jQuery magic), so you have more styling control with a handle on a surrounding div...and can still match the child using a descendant selector.

In your case, you can add to the stylesheet:

#blank-to-do-today img {
  width: ...;
  height: ...;
}

or

#blank-to-do-today > .content > img {
  ...
}

-Dan 




On Sun, Jun 8, 2014 at 9:34 PM, Daniel Hinojosa [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I need it of fixed size.  I think I can do it with CSS, BUT I noticed that when I create an "id" for an image, for example:

== Todo Today 2
[.todotoday]
--
[[blank-to-do-today]]   <--------------  Image ID?
image::blank-to-do-today-list.png[ToDoToday]

[.line1]
This text is displayed in line 1.
--
<<<<

The actual id is on a div and _Not_ on an image
<div class="openblock todotoday">
  <div class="content">
     <div class="imageblock" id="blank-to-do-today">  <----dude, what?
         <div class="content">
             ToDoToday <-- Y No id Here?
          </div>
     </div>
     <div class="paragraph line1"><p>This text is displayed in line 1.</p></div>
   </div>
</div>

So how do I get around this perplexing issue
All my love,
Danno


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-do-I-turn-off-image-scaling-tp1795.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--