---
title: "css_styled_content und IMAGE cObject: Hilfe!"
url: "https://www.typo3.net/d/117946-css-styled-content-und-image-cobject-hilfe"
source: "typo3.net"
tags: ["TYPO3","TypoScript","Frage","TYPO3 4.x"]
created: "2014-04-25"
last_reply: "2014-04-29"
replies: 4
solved: true
page: 1
pages: 1
lang: "de"
---

# css_styled_content und IMAGE cObject: Hilfe!

TYPO3 › TypoScript · 4 Antworten · gelöst · gestartet 2014-04-25

## Frage

**Unbekannter Benutzer** · 2014-04-25 · [Beitrag #1](https://www.typo3.net/d/117946-css-styled-content-und-image-cobject-hilfe/1)

Liebe Leute,

ich gebs auf - wer kann mir helfen?

Ich implementiere ein responsive layout auf meinem 4.5.32.

Dazu gehört, dass die images (aus tt_content) im tag keine width stehen haben - werden mit css skaliert.

css_styled_content wirft mir aber trotz aller Versuche, ihm dies mit typoscript abzugewöhnen, immer Bildbreiten aus:

```html
<img width="395" height="168" border="0" alt="" src="typo3temp/pics/b1e7fdee5d.jpg"
```

Wie gewöhne ich css_styled_content ab, mir hier width, height und border auszugeben?

Vielen Dank,
Claus

## Beste Antwort

**protos** · 2014-04-26 · [Beitrag #2](https://www.typo3.net/d/117946-css-styled-content-und-image-cobject-hilfe/2)

Hallo Claus,

das geht nicht ist hardcoded in sysext/cms/tslib/class.tslib_content.php.

```php
	function cImage($file, $conf) {
		$info = $this->getImgResource($file, $conf['file.']);
		$GLOBALS['TSFE']->lastImageInfo = $info;
		if (is_array($info)) {
			$info[3] = t3lib_div::png_to_gif_by_imagemagick($info[3]);
			$GLOBALS['TSFE']->imagesOnPage[] = $info[3]; // This array is used to collect the image-refs on the page...


				// Backwards compatibility if altText is not set and alttext is set
				// @deprecated since TYPO3 4.3, will be removed in TYPO3 4.6
			if (strlen($conf['alttext']) || is_array($conf['alttext.'])) {
				$GLOBALS['TSFE']->logDeprecatedTyposcript(
					'IMAGE.alttext',
					'use IMAGE.altText instead - src: ' . $info[3] . ' - original image: ' . $info['origFile']
				);
				if (!strlen($conf['altText']) && !is_array($conf['altText.'])) {
					$conf['altText'] = $conf['alttext'];
					$conf['altText.'] = $conf['alttext.'];
				}
			}

			$altParam = $this->getAltParam($conf);
			if($conf['params'] && !isset($conf['params.'])) {
				$params = ' ' . $conf['params'];
			} else {
				$params = isset($conf['params.'])
					? ' ' . $this->stdWrap($conf['params'], $conf['params.'])
					: '';
			}
			$theValue = '<img src="' . htmlspecialchars($GLOBALS['TSFE']->absRefPrefix .
				t3lib_div::rawUrlEncodeFP($info[3])) . '" width="' . $info[0] . '" height="' . $info[1] . '"' .
				$this->getBorderAttr(' border="' . intval($conf['border']) . '"') .
				$params .
				($altParam) . ' />';
			$linkWrap = isset($conf['linkWrap.'])
				? $this->stdWrap($conf['linkWrap'], $conf['linkWrap.'])
				: $conf['linkWrap'];
			if ($linkWrap) {
				$theValue = $this->linkWrap($theValue, $linkWrap);
			} elseif ($conf['imageLinkWrap']) {
				$theValue = $this->imageLinkWrap($theValue, $info['origFile'], $conf['imageLinkWrap.']);
			}
			$wrap = isset($conf['wrap.'])
				? $this->stdWrap($conf['wrap'], $conf['wrap.'])
				: $conf['wrap'];
			if($wrap) {
				$theValue = $this->wrap($theValue, $conf['wrap']);
			}
			return $theValue;
		}
	}
```

Was Du machen kannst ist das ganze mit jquery entfernen: $('img').removeAttr('width').removeAttr('height');

Lies dir aber bitte mal das durch: <http://t3n.de/fragen/responsive-web-design-mit-typo3-moeglich>

Denke das mit den responsive Images geht auch so.

Zitat:

> Das braucht man gar nicht. Es reicht auch, wenn man das per CSS angibt. Die Stylesheets (width:auto; max-width: 100%) sind wichtiger als die Attribute width und height im Image-Element. Jedes IMG-Tag im DOM zu suchen und dann zu bearbeiten ist auch nicht wirklich Performance steigernd.

Viele Grüße,

Carlos

## Antworten

### [#2](https://www.typo3.net/d/117946-css-styled-content-und-image-cobject-hilfe/2) · protos · 2014-04-26 · Beste Antwort

(Text siehe oben unter „Beste Antwort“.)

### [#3](https://www.typo3.net/d/117946-css-styled-content-und-image-cobject-hilfe/3) · Unbekannter Benutzer · 2014-04-28

Cool, danke! Heisst, ich muss nur drauf achten, dass mir die Bilder nicht zu klein werden (weil typo3 rendert ja die Bilder), und dann ist wurscht was drin steht? Super, danke!

### [#4](https://www.typo3.net/d/117946-css-styled-content-und-image-cobject-hilfe/4) · protos · 2014-04-28

Würde ich so sehen.

### [#5](https://www.typo3.net/d/117946-css-styled-content-und-image-cobject-hilfe/5) · Unbekannter Benutzer · 2014-04-29

hmm... darf ich gleich nochwas fragen? Wie bekomme ich den IMG-Link auch um die caption herum?

Hintergrund: ich habe mir die caption mit CSS ins Bild gerückt. Wenn ich nun über die caption hovere, ist der Link weg, nur überm Image ist er da. Geht das irgendwie mit inject?

soweit bin ich mal:

```typoscript
tt_content.image.20.rendering.dl.caption.wrap = <figcaption><p>|</p></figcaption>
```

Dankedanke!

---

Quelle: „css_styled_content und IMAGE cObject: Hilfe!“, typo3.net, https://www.typo3.net/d/117946-css-styled-content-und-image-cobject-hilfe
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
